diff options
136 files changed, 3148 insertions, 838 deletions
diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.2__AddServiceTypeColumnToNorthBoundRequest.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.2__AddServiceTypeColumnToNorthBoundRequest.sql new file mode 100644 index 0000000000..1ead94cd9c --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.2__AddServiceTypeColumnToNorthBoundRequest.sql @@ -0,0 +1,7 @@ +use catalogdb; + +ALTER TABLE northbound_request_ref_lookup ADD COLUMN SERVICE_TYPE varchar(200) NULL; +ALTER TABLE northbound_request_ref_lookup + DROP INDEX UK_northbound_request_ref_lookup; +ALTER TABLE northbound_request_ref_lookup +ADD UNIQUE INDEX `UK_northbound_request_ref_lookup` (`MIN_API_VERSION` ASC, `REQUEST_SCOPE` ASC, `ACTION` ASC, `IS_ALACARTE` ASC, `MACRO_ACTION` ASC, `CLOUD_OWNER` ASC, `SERVICE_TYPE` ASC);
\ No newline at end of file diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 98d1917050..9eb3daa5ae 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -211,9 +211,15 @@ VALUES ('volumeGroup', 'createInstance', '1', 'Gr api recipe to create volume-group', '/mso/async/services/WorkflowActionBB', 180, '20c4431c-246d-11e7-93ae-92361f002671'); -INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER) VALUES -('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner'); +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER, SERVICE_TYPE) VALUES +('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner','*'); INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES ('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'my-custom-cloud-owner')); + +INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, MIN_API_VERSION, MAX_API_VERSION, CLOUD_OWNER, SERVICE_TYPE) VALUES +('Service-Create', 'createInstance', 'Service', true, '7','7', 'my-custom-cloud-owner','TRANSPORT'); + +INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES +('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'my-custom-cloud-owner' and SERVICE_TYPE = 'TRANSPORT')); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java index 36f11d30c0..b6cb27caa3 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/valet/beans/ValetUpdateResponse.java @@ -21,7 +21,7 @@ package org.onap.so.adapters.valet.beans; import java.io.Serializable; -import java.util.Map; +import java.util.HashMap; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; @@ -34,7 +34,7 @@ public class ValetUpdateResponse implements Serializable { @JsonProperty("status") private ValetStatus status; @JsonProperty("parameters") - private Map<String, Object> parameters; + private HashMap<String, Object> parameters; public ValetUpdateResponse() { super(); @@ -46,10 +46,10 @@ public class ValetUpdateResponse implements Serializable { public void setStatus(ValetStatus status) { this.status = status; } - public Map<String, Object> getParameters() { + public HashMap<String, Object> getParameters() { return this.parameters; } - public void setParameters(Map<String, Object> parameters) { + public void setParameters(HashMap<String, Object> parameters) { this.parameters = parameters; } diff --git a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java index 270b1bd99c..deb39ac54e 100644 --- a/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java +++ b/adapters/mso-sdnc-adapter/src/main/java/org/onap/so/adapters/sdnc/sdncrest/SDNCServiceRequestTask.java @@ -60,7 +60,7 @@ public class SDNCServiceRequestTask { private BPRestCallback bpRestCallback; @Async - public void runRequest(SDNCServiceRequest request,String msoRequestId,String msoServiceInstanceId,String myUrlSuffix) throws SDNCAdapterException + public void runRequest(SDNCServiceRequest request,String msoRequestId,String msoServiceInstanceId,String myUrlSuffix) { MsoLogger.setLogContext(msoRequestId, msoServiceInstanceId); MsoLogger.setServiceName(getClass().getSimpleName()); @@ -71,7 +71,13 @@ public class SDNCServiceRequestTask { TypedRequestTunables rt = new TypedRequestTunables(sdncRequestId, myUrlSuffix); rt.setServiceKey(sdncService, sdncOperation); - TypedRequestTunables mappedTunables = mapTunables.setTunables(rt); + TypedRequestTunables mappedTunables; + try { + mappedTunables = mapTunables.setTunables(rt); + } catch(SDNCAdapterException e) { + bpRestCallback.send(request.getBPNotificationUrl(), e.getMessage()); + return; + } if (!mappedTunables.getError().isEmpty()) { // Note that the error was logged and alarmed by setTunables() SDNCServiceError error = new SDNCServiceError(request.getSdncRequestId(), diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml index 934aea8241..abf53f96f5 100644 --- a/bpmn/MSOCommonBPMN/pom.xml +++ b/bpmn/MSOCommonBPMN/pom.xml @@ -308,7 +308,7 @@ <dependency> <groupId>org.onap.appc.client</groupId> <artifactId>client-lib</artifactId> - <version>1.3.0</version> + <version>1.4.4</version> <exclusions> <exclusion> <groupId>org.mockito</groupId> @@ -327,7 +327,7 @@ <dependency> <groupId>org.onap.appc.client</groupId> <artifactId>client-kit</artifactId> - <version>1.3.0</version> + <version>1.4.4</version> <exclusions> <exclusion> <groupId>org.mockito</groupId> diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy index 9e71313e09..57af763ed5 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy @@ -20,8 +20,6 @@ package org.onap.so.bpmn.common.scripts; -import groovy.json.JsonSlurper - import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution import org.camunda.bpm.engine.variable.VariableMap @@ -30,11 +28,13 @@ import org.camunda.bpm.engine.variable.Variables.SerializationDataFormats import org.camunda.bpm.engine.variable.impl.value.ObjectValueImpl import org.onap.so.bpmn.common.workflow.context.WorkflowCallbackResponse import org.onap.so.bpmn.common.workflow.context.WorkflowContextHolder -import org.onap.so.bpmn.core.WorkflowException import org.onap.so.bpmn.core.UrnPropertiesReader +import org.onap.so.bpmn.core.WorkflowException import org.onap.so.client.aai.AAIResourcesClient import org.springframework.web.util.UriUtils +import groovy.json.JsonSlurper + public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcessor { public MsoUtils utils = new MsoUtils() @@ -767,4 +767,4 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess public AAIResourcesClient getAAIClient(){ return new AAIResourcesClient(); } -}
\ No newline at end of file +} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy index 9fd16340b6..f96e3bea0e 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy @@ -174,7 +174,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { String newPersonaModelId = execution.getVariable('UAAIGenVnf_personaModelId') String newPersonaModelVersion = execution.getVariable('UAAIGenVnf_personaModelVersion') - String personaModelVersionEntry = "" + String personaModelVersionEntry = null if (newPersonaModelId != null || newPersonaModelVersion != null) { if (newPersonaModelId != genericVnf.getModelInvariantId()) { def msg = 'Can\'t update Generic VNF ' + vnfId + ' since there is \'persona-model-id\' mismatch between the current and new values' @@ -188,7 +188,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { // Handle ipv4-oam-address String ipv4OamAddress = execution.getVariable('UAAIGenVnf_ipv4OamAddress') - String ipv4OamAddressEntry = "" + String ipv4OamAddressEntry = null if (ipv4OamAddress != null) { // Construct payload ipv4OamAddressEntry = updateGenericVnfNode(origRequest, 'ipv4-oam-address') @@ -196,7 +196,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { // Handle management-v6-address String managementV6Address = execution.getVariable('UAAIGenVnf_managementV6Address') - String managementV6AddressEntry = "" + String managementV6AddressEntry = null if (managementV6Address != null) { // Construct payload managementV6AddressEntry = updateGenericVnfNode(origRequest, 'management-v6-address') @@ -204,21 +204,19 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { // Handle orchestration-status String orchestrationStatus = execution.getVariable('UAAIGenVnf_orchestrationStatus') - String orchestrationStatusEntry = "" + String orchestrationStatusEntry = null if (orchestrationStatus != null) { // Construct payload orchestrationStatusEntry = updateGenericVnfNode(origRequest, 'orchestration-status') } - - String payload = """ - { ${personaModelVersionEntry} - ${ipv4OamAddressEntry} - ${managementV6AddressEntry} - ${orchestrationStatusEntry} - "vnf-id": "${vnfId}" - } - """ - + + org.onap.aai.domain.yang.GenericVnf payload = new org.onap.aai.domain.yang.GenericVnf(); + payload.setVnfId(vnfId) + payload.setPersonaModelVersion(personaModelVersionEntry) + payload.setIpv4OamAddress(ipv4OamAddressEntry) + payload.setManagementV6Address(managementV6AddressEntry) + payload.setOrchestrationStatus(orchestrationStatusEntry) + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) try { @@ -246,16 +244,16 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor { public String updateGenericVnfNode(String origRequest, String elementName) { if (!utils.nodeExists(origRequest, elementName)) { - return "" + return null } def elementValue = utils.getNodeText(origRequest, elementName) if (elementValue == 'DELETE') { - // Set the element being deleted to null - return """"${elementName}": null,""" + // Set the element being deleted to empty string + return "" } else { - return """"${elementName}": "${elementValue}",""" + return elementValue } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java index 6c2df13c61..d2e0b07dd1 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildingBlockRainyDay.java @@ -53,6 +53,7 @@ public class ExecuteBuildingBlockRainyDay { @Autowired private Environment environment; protected String retryDurationPath = "mso.rainyDay.retryDurationMultiplier"; + protected String defaultCode = "mso.rainyDay.defaultCode"; public void setRetryTimer(DelegateExecution execution) { try { @@ -149,7 +150,8 @@ public class ExecuteBuildingBlockRainyDay { execution.setVariable(HANDLING_CODE, handlingCode); } catch (Exception e) { msoLogger.error("Failed to determine RainyDayHandler Status. Seting handlingCode = Abort"); - execution.setVariable(HANDLING_CODE, "Abort"); + String code = this.environment.getProperty(defaultCode); + execution.setVariable(HANDLING_CODE, code); } } diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn index 0032b0e0b7..0ef6c84494 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn @@ -20,7 +20,7 @@ ExceptionUtil exceptionUtil = new ExceptionUtil() exceptionUtil.buildWorkflowException(execution, 7000, "Could not communicate with the SDNC Adapter" )]]></bpmn2:script> </bpmn2:scriptTask> <bpmn2:sequenceFlow id="Exception" name="Exception" sourceRef="setBadResponse" targetRef="badResponseEndFlow" /> - <bpmn2:serviceTask id="invokeSDNCAdapter" name="Invoke SDNC Adapter" camunda:asyncAfter="true" camunda:class=""> + <bpmn2:serviceTask id="invokeSDNCAdapter" name="Invoke SDNC Adapter" camunda:class=""> <bpmn2:extensionElements> <camunda:connector> <camunda:inputOutput> diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java index 9af9b2f2c9..cb5683dcc8 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/ExecuteBuildlingBlockRainyDayTest.java @@ -21,7 +21,7 @@ package org.onap.so.bpmn.servicedecomposition.tasks; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.eq; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; diff --git a/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml b/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml index 1651f4f1fc..18f94f3b88 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml +++ b/bpmn/MSOCommonBPMN/src/test/resources/application-test.yaml @@ -110,6 +110,7 @@ mso: rollback: 'true' rainyDay: retryDurationMultiplier: '2' + defaultCode: Abort site-name: localDevEnv workflow: default: diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn index 21f2fbeeb9..52b9249468 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateNetworkBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.9.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_MagIIMOUEeW8asg-vCEgWQ" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> <bpmn2:process id="CreateNetworkBB" name="CreateNetworkBB" isExecutable="true"> <bpmn2:startEvent id="createNetwork_startEvent"> <bpmn2:outgoing>SequenceFlow_1maepy7</bpmn2:outgoing> @@ -13,7 +13,7 @@ </bpmn2:serviceTask> <bpmn2:serviceTask id="Create_Network_ServiceTask" name=" AIC Create (network) " camunda:expression="${NetworkAdapterCreateTasks.createNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn2:incoming>SequenceFlow_1eqfh23</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_0innva6</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_1fm99t6</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:serviceTask id="QueryNetworkPolicy_ServiceTask" name=" AAI Query (net policy) " camunda:expression="${AAIQueryTasks.queryNetworkPolicy(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn2:incoming>SequenceFlow_0n42zi5</bpmn2:incoming> @@ -24,12 +24,11 @@ <bpmn2:outgoing>SequenceFlow_1h9kkhb</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:serviceTask id="Update_Network_AAI_ServiceTask" name=" AAI Update (network) " camunda:expression="${AAIUpdateTasks.updateNetworkCreated(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn2:incoming>SequenceFlow_0innva6</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_16152be</bpmn2:incoming> <bpmn2:outgoing>SequenceFlow_0sissul</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:sequenceFlow id="SequenceFlow_0n42zi5" sourceRef="QueryVpnBinding_ServiceTask" targetRef="QueryNetworkPolicy_ServiceTask" /> <bpmn2:sequenceFlow id="SequenceFlow_1yy4aik" sourceRef="QueryNetworkPolicy_ServiceTask" targetRef="QueryNetworkTableRef_ServiceTask" /> - <bpmn2:sequenceFlow id="SequenceFlow_0innva6" sourceRef="Create_Network_ServiceTask" targetRef="Update_Network_AAI_ServiceTask" /> <bpmn2:sequenceFlow id="SequenceFlow_0sissul" sourceRef="Update_Network_AAI_ServiceTask" targetRef="createNetwork_EndEvent" /> <bpmn2:sequenceFlow id="SequenceFlow_1maepy7" sourceRef="createNetwork_startEvent" targetRef="ServiceTask_get_cloud_region" /> <bpmn2:intermediateThrowEvent id="ThrowEvent_ToCollectAAIData" name="ThrowEvent_ToCollectAAIData"> @@ -45,7 +44,7 @@ <bpmn2:linkEventDefinition name="CatchEvent_Create_Network" /> </bpmn2:intermediateCatchEvent> <bpmn2:intermediateThrowEvent id="ThrowEvent_ToCreateNetwork" name="ThrowEvent_ToCreateNetwork"> - <bpmn2:incoming>SequenceFlow_04w6hdq</bpmn2:incoming> + <bpmn2:incoming>SequenceFlow_0y0w60u</bpmn2:incoming> <bpmn2:linkEventDefinition name="CatchEvent_Create_Network" /> </bpmn2:intermediateThrowEvent> <bpmn2:sequenceFlow id="SequenceFlow_1h9kkhb" sourceRef="QueryNetworkTableRef_ServiceTask" targetRef="QueryNetworkSubnet_ServiceTask" /> @@ -56,11 +55,27 @@ <bpmn2:outgoing>SequenceFlow_03ebe6c</bpmn2:outgoing> </bpmn2:serviceTask> <bpmn2:sequenceFlow id="SequenceFlow_03ebe6c" sourceRef="ServiceTask_get_cloud_region" targetRef="ThrowEvent_ToCollectAAIData" /> + <bpmn2:callActivity id="CallActivity_0aj19il" name="Call NetworkAdapterRestV1" calledElement="NetworkAdapterRestV1"> + <bpmn2:extensionElements> + <camunda:in source="networkAdapterRequest" target="networkAdapterRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="createNetworkResponse" target="createNetworkResponse" /> + </bpmn2:extensionElements> + <bpmn2:incoming>SequenceFlow_1fm99t6</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_0qpu80i</bpmn2:outgoing> + </bpmn2:callActivity> + <bpmn2:serviceTask id="ServiceTask_1k8gsz5" name="Process Response From Openstack" camunda:expression="${NetworkAdapterCreateTasks.processResponseFromOpenstack(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> + <bpmn2:incoming>SequenceFlow_0qpu80i</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_16152be</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_0qpu80i" sourceRef="CallActivity_0aj19il" targetRef="ServiceTask_1k8gsz5" /> + <bpmn2:sequenceFlow id="SequenceFlow_16152be" sourceRef="ServiceTask_1k8gsz5" targetRef="Update_Network_AAI_ServiceTask" /> + <bpmn2:sequenceFlow id="SequenceFlow_1fm99t6" sourceRef="Create_Network_ServiceTask" targetRef="CallActivity_0aj19il" /> <bpmn2:serviceTask id="QueryNetworkSubnet_ServiceTask" name=" AAI Query (subnet) " camunda:expression="${AAIQueryTasks.querySubnet(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn2:incoming>SequenceFlow_1h9kkhb</bpmn2:incoming> - <bpmn2:outgoing>SequenceFlow_04w6hdq</bpmn2:outgoing> + <bpmn2:outgoing>SequenceFlow_0y0w60u</bpmn2:outgoing> </bpmn2:serviceTask> - <bpmn2:sequenceFlow id="SequenceFlow_04w6hdq" sourceRef="QueryNetworkSubnet_ServiceTask" targetRef="ThrowEvent_ToCreateNetwork" /> + <bpmn2:sequenceFlow id="SequenceFlow_0y0w60u" sourceRef="QueryNetworkSubnet_ServiceTask" targetRef="ThrowEvent_ToCreateNetwork" /> </bpmn2:process> <bpmn2:error id="Error_2" name="MSOWorkflowException" errorCode="MSOWorkflowException" /> <bpmn2:error id="Error_1" name="java.lang.Exception" errorCode="java.lang.Exception" /> @@ -73,9 +88,9 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_10l9a3s_di" bpmnElement="createNetwork_EndEvent"> - <dc:Bounds x="656" y="326" width="36" height="36" /> + <dc:Bounds x="997" y="326" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="652" y="362" width="46" height="12" /> + <dc:Bounds x="971" y="362" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_1k7d8ih_di" bpmnElement="QueryVpnBinding_ServiceTask"> @@ -91,7 +106,7 @@ <dc:Bounds x="663" y="91" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0q51h0f_di" bpmnElement="Update_Network_AAI_ServiceTask"> - <dc:Bounds x="499" y="304" width="100" height="80" /> + <dc:Bounds x="836" y="304" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0n42zi5_di" bpmnElement="SequenceFlow_0n42zi5"> <di:waypoint xsi:type="dc:Point" x="440" y="131" /> @@ -107,18 +122,11 @@ <dc:Bounds x="633" y="106" width="0" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_0innva6_di" bpmnElement="SequenceFlow_0innva6"> - <di:waypoint xsi:type="dc:Point" x="446" y="344" /> - <di:waypoint xsi:type="dc:Point" x="499" y="344" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="473" y="319" width="0" height="0" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_0sissul_di" bpmnElement="SequenceFlow_0sissul"> - <di:waypoint xsi:type="dc:Point" x="599" y="344" /> - <di:waypoint xsi:type="dc:Point" x="656" y="344" /> + <di:waypoint xsi:type="dc:Point" x="936" y="344" /> + <di:waypoint xsi:type="dc:Point" x="997" y="344" /> <bpmndi:BPMNLabel> - <dc:Bounds x="628" y="319" width="0" height="0" /> + <dc:Bounds x="921.5" y="329" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1maepy7_di" bpmnElement="SequenceFlow_1maepy7"> @@ -147,16 +155,16 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="IntermediateThrowEvent_04qwhex_di" bpmnElement="ThrowEvent_ToCreateNetwork"> - <dc:Bounds x="972" y="113" width="36" height="36" /> + <dc:Bounds x="962" y="113" width="36" height="36" /> <bpmndi:BPMNLabel> - <dc:Bounds x="1015" y="125" width="86" height="24" /> + <dc:Bounds x="1005" y="125" width="86" height="24" /> </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1h9kkhb_di" bpmnElement="SequenceFlow_1h9kkhb"> <di:waypoint xsi:type="dc:Point" x="763" y="131" /> - <di:waypoint xsi:type="dc:Point" x="818" y="131" /> + <di:waypoint xsi:type="dc:Point" x="817" y="131" /> <bpmndi:BPMNLabel> - <dc:Bounds x="745.5" y="116" width="90" height="0" /> + <dc:Bounds x="745" y="116" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1oc7wcr_di" bpmnElement="SequenceFlow_1oc7wcr"> @@ -183,14 +191,41 @@ <dc:Bounds x="551" y="-52" width="90" height="0" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> - <bpmndi:BPMNShape id="ServiceTask_0j3odqk_di" bpmnElement="QueryNetworkSubnet_ServiceTask"> - <dc:Bounds x="818" y="91" width="100" height="80" /> + <bpmndi:BPMNShape id="CallActivity_0aj19il_di" bpmnElement="CallActivity_0aj19il"> + <dc:Bounds x="503" y="304" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1k8gsz5_di" bpmnElement="ServiceTask_1k8gsz5"> + <dc:Bounds x="663" y="304" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0qpu80i_di" bpmnElement="SequenceFlow_0qpu80i"> + <di:waypoint xsi:type="dc:Point" x="603" y="344" /> + <di:waypoint xsi:type="dc:Point" x="663" y="344" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="633" y="323" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_16152be_di" bpmnElement="SequenceFlow_16152be"> + <di:waypoint xsi:type="dc:Point" x="763" y="344" /> + <di:waypoint xsi:type="dc:Point" x="836" y="344" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="799.5" y="323" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1fm99t6_di" bpmnElement="SequenceFlow_1fm99t6"> + <di:waypoint xsi:type="dc:Point" x="446" y="344" /> + <di:waypoint xsi:type="dc:Point" x="503" y="344" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="474.5" y="323" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_0u4ie2q_di" bpmnElement="QueryNetworkSubnet_ServiceTask"> + <dc:Bounds x="817" y="91" width="100" height="80" /> </bpmndi:BPMNShape> - <bpmndi:BPMNEdge id="SequenceFlow_04w6hdq_di" bpmnElement="SequenceFlow_04w6hdq"> - <di:waypoint xsi:type="dc:Point" x="918" y="131" /> - <di:waypoint xsi:type="dc:Point" x="972" y="131" /> + <bpmndi:BPMNEdge id="SequenceFlow_0y0w60u_di" bpmnElement="SequenceFlow_0y0w60u"> + <di:waypoint xsi:type="dc:Point" x="917" y="131" /> + <di:waypoint xsi:type="dc:Point" x="962" y="131" /> <bpmndi:BPMNLabel> - <dc:Bounds x="945" y="110" width="0" height="12" /> + <dc:Bounds x="939.5" y="110" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn index 95e481db4f..74b78ef735 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteNetworkBB.bpmn @@ -5,19 +5,29 @@ <bpmn:outgoing>SequenceFlow_1mc3d3f</bpmn:outgoing> </bpmn:startEvent> <bpmn:serviceTask id="updateNetworkAAI" name=" AAI Update (network) " camunda:expression="${AAIUpdateTasks.updateOrchestrationStatusAssignedNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> - <bpmn:incoming>SequenceFlow_1c906im</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0gnafn2</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0nhd7b7</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1mc3d3f" sourceRef="deleteNetwork_startEvent" targetRef="deleteNetworkAIC" /> - <bpmn:sequenceFlow id="SequenceFlow_1c906im" sourceRef="deleteNetworkAIC" targetRef="updateNetworkAAI" /> <bpmn:serviceTask id="deleteNetworkAIC" name=" AIC Delete (network) " camunda:expression="${NetworkAdapterDeleteTasks.deleteNetwork(InjectExecution.execute(execution, execution.getVariable("gBuildingBlockExecution")))}"> <bpmn:incoming>SequenceFlow_1mc3d3f</bpmn:incoming> - <bpmn:outgoing>SequenceFlow_1c906im</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_16ti327</bpmn:outgoing> </bpmn:serviceTask> <bpmn:endEvent id="deleteNetwork_endEvent"> <bpmn:incoming>SequenceFlow_0nhd7b7</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_0nhd7b7" sourceRef="updateNetworkAAI" targetRef="deleteNetwork_endEvent" /> + <bpmn:callActivity id="CallActivity_1a77pxk" name="Call NetworkAdapterRestV1" calledElement="NetworkAdapterRestV1"> + <bpmn:extensionElements> + <camunda:in source="networkAdapterRequest" target="networkAdapterRequest" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> + <camunda:out source="deleteNetworkResponse" target="deleteNetworkResponse" /> + </bpmn:extensionElements> + <bpmn:incoming>SequenceFlow_16ti327</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0gnafn2</bpmn:outgoing> + </bpmn:callActivity> + <bpmn:sequenceFlow id="SequenceFlow_16ti327" sourceRef="deleteNetworkAIC" targetRef="CallActivity_1a77pxk" /> + <bpmn:sequenceFlow id="SequenceFlow_0gnafn2" sourceRef="CallActivity_1a77pxk" targetRef="updateNetworkAAI" /> </bpmn:process> <bpmn:error id="Error_1l8dsnn" name="Error_31mlvpb" /> <bpmn:error id="Error_0wyyz4k" name="Error_0v8f773" /> @@ -38,24 +48,17 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0zd65z2_di" bpmnElement="updateNetworkAAI"> - <dc:Bounds x="530" y="80" width="100" height="80" /> + <dc:Bounds x="644" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1mc3d3f_di" bpmnElement="SequenceFlow_1mc3d3f"> <di:waypoint xsi:type="dc:Point" x="209" y="120" /> - <di:waypoint xsi:type="dc:Point" x="370" y="120" /> + <di:waypoint xsi:type="dc:Point" x="317" y="120" /> <bpmndi:BPMNLabel> - <dc:Bounds x="244.5" y="99" width="90" height="12" /> - </bpmndi:BPMNLabel> - </bpmndi:BPMNEdge> - <bpmndi:BPMNEdge id="SequenceFlow_1c906im_di" bpmnElement="SequenceFlow_1c906im"> - <di:waypoint xsi:type="dc:Point" x="470" y="120" /> - <di:waypoint xsi:type="dc:Point" x="530" y="120" /> - <bpmndi:BPMNLabel> - <dc:Bounds x="455" y="99" width="90" height="12" /> + <dc:Bounds x="218" y="99" width="90" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_1gcfuzf_di" bpmnElement="deleteNetworkAIC"> - <dc:Bounds x="370" y="80" width="100" height="80" /> + <dc:Bounds x="317" y="80" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="EndEvent_02vxchc_di" bpmnElement="deleteNetwork_endEvent"> <dc:Bounds x="806" y="102" width="36" height="36" /> @@ -64,10 +67,27 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0nhd7b7_di" bpmnElement="SequenceFlow_0nhd7b7"> - <di:waypoint xsi:type="dc:Point" x="630" y="120" /> + <di:waypoint xsi:type="dc:Point" x="744" y="120" /> <di:waypoint xsi:type="dc:Point" x="806" y="120" /> <bpmndi:BPMNLabel> - <dc:Bounds x="673" y="99" width="90" height="12" /> + <dc:Bounds x="730" y="99" width="90" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="CallActivity_1a77pxk_di" bpmnElement="CallActivity_1a77pxk"> + <dc:Bounds x="481" y="80" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_16ti327_di" bpmnElement="SequenceFlow_16ti327"> + <di:waypoint xsi:type="dc:Point" x="417" y="120" /> + <di:waypoint xsi:type="dc:Point" x="481" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="449" y="99" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_0gnafn2_di" bpmnElement="SequenceFlow_0gnafn2"> + <di:waypoint xsi:type="dc:Point" x="581" y="120" /> + <di:waypoint xsi:type="dc:Point" x="644" y="120" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="612.5" y="99" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/NetworkAdapterRestV1.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/NetworkAdapterRestV1.bpmn new file mode 100644 index 0000000000..583ec9444e --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/NetworkAdapterRestV1.bpmn @@ -0,0 +1,198 @@ +<?xml version="1.0" encoding="UTF-8"?> +<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="_GraPIIyxEeWmdMDkx6Uftw" targetNamespace="http://camunda.org/schema/1.0/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"> + <bpmn2:process id="NetworkAdapterRestV1" name="NetworkAdapterRestV1" isExecutable="true"> + <bpmn2:boundaryEvent id="BoundaryEvent_1" name="Timeout" attachedToRef="waitForAsyncMessage"> + <bpmn2:outgoing>SequenceFlow_27</bpmn2:outgoing> + <bpmn2:timerEventDefinition id="TimerEventDefinition_1"> + <bpmn2:timeDuration xsi:type="bpmn2:tFormalExpression"><![CDATA[${UrnPropertiesReader.getVariable("mso.po.timeout", execution)}]]></bpmn2:timeDuration> + </bpmn2:timerEventDefinition> + </bpmn2:boundaryEvent> + <bpmn2:subProcess id="waitForAsyncMessage" name="Wait for Callback"> + <bpmn2:incoming>SequenceFlow_1286mqm</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_28</bpmn2:outgoing> + <bpmn2:intermediateCatchEvent id="IntermediateCatchEvent_1" name="Catch Event"> + <bpmn2:incoming>SequenceFlow_25</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_26</bpmn2:outgoing> + <bpmn2:messageEventDefinition id="MessageEventDefinition_1" messageRef="Message_1" /> + </bpmn2:intermediateCatchEvent> + <bpmn2:sequenceFlow id="SequenceFlow_26" name="" sourceRef="IntermediateCatchEvent_1" targetRef="EndEvent_2" /> + <bpmn2:startEvent id="StartEvent_3"> + <bpmn2:outgoing>SequenceFlow_25</bpmn2:outgoing> + </bpmn2:startEvent> + <bpmn2:sequenceFlow id="SequenceFlow_25" name="" sourceRef="StartEvent_3" targetRef="IntermediateCatchEvent_1" /> + <bpmn2:endEvent id="EndEvent_2"> + <bpmn2:incoming>SequenceFlow_26</bpmn2:incoming> + </bpmn2:endEvent> + </bpmn2:subProcess> + <bpmn2:sequenceFlow id="SequenceFlow_27" name="" sourceRef="BoundaryEvent_1" targetRef="ScriptTask_5" /> + <bpmn2:sequenceFlow id="SequenceFlow_28" name="" sourceRef="waitForAsyncMessage" targetRef="ServiceTask_6" /> + <bpmn2:sequenceFlow id="SequenceFlow_34" name="" sourceRef="ScriptTask_5" targetRef="EndEvent_8" /> + <bpmn2:endEvent id="EndEvent_8"> + <bpmn2:incoming>SequenceFlow_34</bpmn2:incoming> + <bpmn2:errorEventDefinition id="_ErrorEventDefinition_21" errorRef="Error_1" /> + </bpmn2:endEvent> + <bpmn2:endEvent id="EndEvent_6" name="End Flow"> + <bpmn2:incoming>SequenceFlow_06donih</bpmn2:incoming> + </bpmn2:endEvent> + <bpmn2:startEvent id="StartEvent_1" name="Start"> + <bpmn2:outgoing>SequenceFlow_9</bpmn2:outgoing> + </bpmn2:startEvent> + <bpmn2:sequenceFlow id="SequenceFlow_9" name="" sourceRef="StartEvent_1" targetRef="Call_NetworkAdapter" /> + <bpmn2:serviceTask id="Call_NetworkAdapter" name="Call Network Adapter" camunda:expression="${NetworkAdapterRestV1.callNetworkAdapter(execution)}"> + <bpmn2:incoming>SequenceFlow_9</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_1286mqm</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:serviceTask id="ServiceTask_4" name="Workflow Exception (bad response)" camunda:expression="${NetworkAdapterRestV1.handleSyncError(execution)}"> + <bpmn2:incoming>SequenceFlow_1qckanf</bpmn2:incoming> + </bpmn2:serviceTask> + <bpmn2:serviceTask id="ScriptTask_5" name="Workflow Exception (timeout)" camunda:expression="${NetworkAdapterRestV1.handleTimeOutException(execution)}"> + <bpmn2:incoming>SequenceFlow_27</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_34</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:serviceTask id="ServiceTask_6" name="Process Callback" camunda:expression="${NetworkAdapterRestV1.processCallback(execution)}"> + <bpmn2:incoming>SequenceFlow_28</bpmn2:incoming> + <bpmn2:outgoing>SequenceFlow_06donih</bpmn2:outgoing> + </bpmn2:serviceTask> + <bpmn2:sequenceFlow id="SequenceFlow_06donih" sourceRef="ServiceTask_6" targetRef="EndEvent_6" /> + <bpmn2:boundaryEvent id="BoundaryEvent_1edt16j" attachedToRef="Call_NetworkAdapter"> + <bpmn2:outgoing>SequenceFlow_1qckanf</bpmn2:outgoing> + <bpmn2:errorEventDefinition /> + </bpmn2:boundaryEvent> + <bpmn2:sequenceFlow id="SequenceFlow_1qckanf" sourceRef="BoundaryEvent_1edt16j" targetRef="ServiceTask_4" /> + <bpmn2:sequenceFlow id="SequenceFlow_1286mqm" sourceRef="Call_NetworkAdapter" targetRef="waitForAsyncMessage" /> + </bpmn2:process> + <bpmn2:error id="Error_1" name="MSO Workflow Exception" errorCode="MSOWorkflowException" /> + <bpmn2:message id="Message_1" name="WorkflowMessage" /> + <bpmndi:BPMNDiagram id="BPMNDiagram_1"> + <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="NetworkAdapterRestV1"> + <bpmndi:BPMNShape id="_BPMNShape_SubProcess_14" bpmnElement="waitForAsyncMessage" isExpanded="true"> + <dc:Bounds x="685" y="110" width="265" height="154" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="_BPMNShape_BoundaryEvent_24" bpmnElement="BoundaryEvent_1"> + <dc:Bounds x="800" y="246" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="841" y="276" width="41" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="_BPMNShape_IntermediateCatchEvent_20" bpmnElement="IntermediateCatchEvent_1"> + <dc:Bounds x="804" y="165" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="792" y="206" width="61" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_54" bpmnElement="StartEvent_1"> + <dc:Bounds x="340" y="169" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="346" y="210" width="24" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_2" bpmnElement="SequenceFlow_9" sourceElement="_BPMNShape_StartEvent_54" targetElement="ServiceTask_1tl2aox_di"> + <di:waypoint xsi:type="dc:Point" x="376" y="187" /> + <di:waypoint xsi:type="dc:Point" x="453" y="187" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="369.5" y="169" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_StartEvent_55" bpmnElement="StartEvent_3"> + <dc:Bounds x="709" y="165" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="682" y="206" width="90" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_27" bpmnElement="SequenceFlow_25" sourceElement="_BPMNShape_StartEvent_55" targetElement="_BPMNShape_IntermediateCatchEvent_20"> + <di:waypoint xsi:type="dc:Point" x="745" y="183" /> + <di:waypoint xsi:type="dc:Point" x="804" y="183" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="732" y="183" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_EndEvent_156" bpmnElement="EndEvent_2"> + <dc:Bounds x="889" y="165" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="862" y="206" width="90" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_28" bpmnElement="SequenceFlow_26" sourceElement="_BPMNShape_IntermediateCatchEvent_20" targetElement="_BPMNShape_EndEvent_156"> + <di:waypoint xsi:type="dc:Point" x="840" y="183" /> + <di:waypoint xsi:type="dc:Point" x="870" y="183" /> + <di:waypoint xsi:type="dc:Point" x="870" y="182" /> + <di:waypoint xsi:type="dc:Point" x="889" y="183" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="825" y="183" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_29" bpmnElement="SequenceFlow_27" sourceElement="_BPMNShape_BoundaryEvent_24" targetElement="ServiceTask_1y9aa0r_di"> + <di:waypoint xsi:type="dc:Point" x="818" y="282" /> + <di:waypoint xsi:type="dc:Point" x="818" y="327" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="788" y="302" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_30" bpmnElement="SequenceFlow_28" sourceElement="_BPMNShape_SubProcess_14" targetElement="ServiceTask_1s8txq3_di"> + <di:waypoint xsi:type="dc:Point" x="950" y="186" /> + <di:waypoint xsi:type="dc:Point" x="992" y="186" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="926" y="168" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="_BPMNShape_EndEvent_158" bpmnElement="EndEvent_6"> + <dc:Bounds x="1131" y="168" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1126" y="209" width="46" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="_BPMNShape_EndEvent_160" bpmnElement="EndEvent_8"> + <dc:Bounds x="915" y="349" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="888" y="390" width="90" height="0" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="BPMNEdge_SequenceFlow_36" bpmnElement="SequenceFlow_34" sourceElement="ServiceTask_1y9aa0r_di" targetElement="_BPMNShape_EndEvent_160"> + <di:waypoint xsi:type="dc:Point" x="868" y="367" /> + <di:waypoint xsi:type="dc:Point" x="915" y="367" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="847" y="349" width="90" height="6" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ServiceTask_1tl2aox_di" bpmnElement="Call_NetworkAdapter"> + <dc:Bounds x="453" y="147" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_0rll4jo_di" bpmnElement="ServiceTask_4"> + <dc:Bounds x="503" y="327" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1y9aa0r_di" bpmnElement="ScriptTask_5"> + <dc:Bounds x="768" y="327" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNShape id="ServiceTask_1s8txq3_di" bpmnElement="ServiceTask_6"> + <dc:Bounds x="992" y="146" width="100" height="80" /> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_06donih_di" bpmnElement="SequenceFlow_06donih"> + <di:waypoint xsi:type="dc:Point" x="1092" y="186" /> + <di:waypoint xsi:type="dc:Point" x="1131" y="186" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1111.5" y="165" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="BoundaryEvent_0ubdwuw_di" bpmnElement="BoundaryEvent_1edt16j"> + <dc:Bounds x="535" y="209" width="36" height="36" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="553" y="249" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_1qckanf_di" bpmnElement="SequenceFlow_1qckanf"> + <di:waypoint xsi:type="dc:Point" x="553" y="245" /> + <di:waypoint xsi:type="dc:Point" x="553" y="327" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="568" y="280" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1286mqm_di" bpmnElement="SequenceFlow_1286mqm"> + <di:waypoint xsi:type="dc:Point" x="553" y="187" /> + <di:waypoint xsi:type="dc:Point" x="685" y="187" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="619" y="166" width="0" height="12" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> + </bpmndi:BPMNPlane> + </bpmndi:BPMNDiagram> +</bpmn2:definitions> diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn index 38a1ccdf35..70ae02b0fe 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn @@ -1,5 +1,5 @@ <?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="1.4.0"> +<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="WorkflowActionBB" name="WorkflowActionBB" isExecutable="true"> <bpmn:startEvent id="Start_WorkflowActionBB" name="start"> <bpmn:outgoing>SequenceFlow_15s0okp</bpmn:outgoing> @@ -22,6 +22,7 @@ <camunda:out source="orchestrationStatusValidationResult" target="orchestrationStatusValidationResult" /> <camunda:out source="RetryDuration" target="RetryDuration" /> <camunda:in source="suppressRollback" target="suppressRollback" /> + <camunda:out source="WorkflowException" target="WorkflowException" /> </bpmn:extensionElements> <bpmn:incoming>SequenceFlow_0mew9im</bpmn:incoming> <bpmn:outgoing>SequenceFlow_07h9d4y</bpmn:outgoing> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy index c95704e51a..67fbb97797 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteNetworkInstance.groovy @@ -451,10 +451,11 @@ public class DoDeleteNetworkInstance extends AbstractServiceTaskProcessor { URL url = new URL(vnfAdapterUrl) HttpClient httpClient = new HttpClientFactory().newXmlClient(url, TargetEntity.OPENSTACK_ADAPTER) + httpClient.accept = "application/xml" httpClient.addAdditionalHeader("Authorization", execution.getVariable("BasicAuthHeaderValuePO")) Response response = httpClient.delete(vnfAdapterRequest) - + execution.setVariable(Prefix + "deleteNetworkResponse", response.readEntity(String.class)) execution.setVariable(Prefix + "networkReturnCode", response.getStatus()) } catch (Exception ex) { diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java index 8bba435d0c..d57e48781d 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.infrastructure.pnf.aai; import java.util.Optional; -import java.util.UUID; import org.onap.aai.domain.yang.Pnf; import org.onap.so.bpmn.infrastructure.pnf.implementation.AaiConnection; import org.onap.so.client.aai.AAIRestClientImpl; @@ -33,12 +32,12 @@ public class AaiConnectionImpl implements AaiConnection { @Override public Optional<Pnf> getEntryFor(String correlationId) { AAIRestClientImpl restClient = new AAIRestClientImpl(); - return restClient.getPnfByName(correlationId, UUID.randomUUID().toString()); + return restClient.getPnfByName(correlationId); } @Override public void createEntry(String correlationId, Pnf entry) { AAIRestClientImpl restClient = new AAIRestClientImpl(); - restClient.createPnf(correlationId, UUID.randomUUID().toString(), entry); + restClient.createPnf(correlationId, entry); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java index bc3845d760..4c531d46f9 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasks.java @@ -21,8 +21,8 @@ package org.onap.so.bpmn.infrastructure.adapter.network.tasks; import java.util.Map; -import java.util.Optional; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; @@ -30,24 +30,23 @@ import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.NetworkAdapterResources; -import org.onap.so.logger.MsoLogger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class NetworkAdapterCreateTasks { - private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, NetworkAdapterCreateTasks.class); @Autowired private ExtractPojosForBB extractPojosForBB; @Autowired - private NetworkAdapterResources networkAdapterResources; - @Autowired private ExceptionBuilder exceptionUtil; - - + @Autowired + private NetworkAdapterObjectMapper networkAdapterObjectMapper; + @Autowired + private NetworkAdapterResources networkAdapterResources; public void createNetwork(BuildingBlockExecution execution) { execution.setVariable("networkAdapterCreateRollback", false); @@ -59,18 +58,29 @@ public class NetworkAdapterCreateTasks { Map<String, String> userInput = gBBInput.getUserInput(); String cloudRegionPo = execution.getVariable("cloudRegionPo"); - Optional<CreateNetworkResponse> oCreateNetworkResponse = networkAdapterResources.createNetwork(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), gBBInput.getOrchContext(), serviceInstance, l3Network, userInput, cloudRegionPo, gBBInput.getCustomer()); - if (oCreateNetworkResponse.isPresent()){ - CreateNetworkResponse createNetworkResponse = oCreateNetworkResponse.get(); + CreateNetworkRequest createNetworkRequest = networkAdapterObjectMapper.createNetworkRequestMapper(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), gBBInput.getOrchContext(), serviceInstance, l3Network, userInput, cloudRegionPo, gBBInput.getCustomer()); + + execution.setVariable("networkAdapterRequest", createNetworkRequest); + } catch (Exception ex) { + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); + } + } + + public void processResponseFromOpenstack(BuildingBlockExecution execution) { + try { + L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID)); + + CreateNetworkResponse createNetworkResponse = execution.getVariable("createNetworkResponse"); + if(createNetworkResponse != null) { l3Network.setHeatStackId(createNetworkResponse.getNetworkStackId()); if (createNetworkResponse.getNetworkCreated()){ //setting rollback TRUE only if network was actually created (not a silent success OP) - execution.setVariable("createNetworkResponse", createNetworkResponse); execution.setVariable("networkAdapterCreateRollback", true); } + } else { + throw new Exception("No response was sent back from NetworkAdapterRestV1 subflow."); } - } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java index 1baa3f5dc9..41dabf9302 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasks.java @@ -20,18 +20,15 @@ package org.onap.so.bpmn.infrastructure.adapter.network.tasks; -import java.util.Optional; - -import org.onap.so.adapters.nwrest.DeleteNetworkResponse; +import org.onap.so.adapters.nwrest.DeleteNetworkRequest; import org.onap.so.bpmn.common.BuildingBlockExecution; -import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; +import org.onap.so.client.adapter.network.mapper.NetworkAdapterObjectMapper; import org.onap.so.client.exception.ExceptionBuilder; -import org.onap.so.client.orchestration.NetworkAdapterResources; import org.onap.so.logger.MsoLogger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -42,7 +39,7 @@ public class NetworkAdapterDeleteTasks { @Autowired private ExtractPojosForBB extractPojosForBB; @Autowired - private NetworkAdapterResources networkAdapterResources; + private NetworkAdapterObjectMapper networkAdapterObjectMapper; @Autowired private ExceptionBuilder exceptionUtil; @@ -53,14 +50,9 @@ public class NetworkAdapterDeleteTasks { L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID, execution.getLookupMap().get(ResourceKey.NETWORK_ID)); ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID, execution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID)); - Optional<DeleteNetworkResponse> oDeleteNetworkResponse = networkAdapterResources.deleteNetwork(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, l3Network); + DeleteNetworkRequest deleteNetworkRequest = networkAdapterObjectMapper.deleteNetworkRequestMapper(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, l3Network); - if (oDeleteNetworkResponse.isPresent()){ - DeleteNetworkResponse deleteNetworkResponse = oDeleteNetworkResponse.get(); - if (deleteNetworkResponse.getNetworkDeleted()) { - execution.setVariable("deleteNetworkResponse", deleteNetworkResponse); - } - } + execution.setVariable("networkAdapterRequest", deleteNetworkRequest); } catch (Exception ex) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java new file mode 100644 index 0000000000..d821223507 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1.java @@ -0,0 +1,123 @@ +package org.onap.so.bpmn.infrastructure.adapter.network.tasks; + +import java.io.StringReader; +import java.util.Optional; + +import javax.ws.rs.core.Response; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Unmarshaller; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.onap.so.adapters.nwrest.CreateNetworkError; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; +import org.onap.so.adapters.nwrest.CreateNetworkResponse; +import org.onap.so.adapters.nwrest.DeleteNetworkError; +import org.onap.so.adapters.nwrest.DeleteNetworkRequest; +import org.onap.so.adapters.nwrest.DeleteNetworkResponse; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.NetworkAdapterResources; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class NetworkAdapterRestV1 { + + private static final Logger logger = LoggerFactory.getLogger(NetworkAdapterRestV1.class); + + private static final String NETWORK_REQUEST = "networkAdapterRequest"; + private static final String NETWORK_MESSAGE = "NetworkAResponse_MESSAGE"; + private static final String NETWORK_SYNC_CODE = "NETWORKREST_networkAdapterStatusCode"; + private static final String NETWORK_SYNC_RESPONSE = "NETWORKREST_networkAdapterResponse"; + private static final String NETWORK_CORRELATOR = "NetworkAResponse_CORRELATOR"; + + @Autowired + private ExceptionBuilder exceptionBuilder; + + @Autowired + private NetworkAdapterResources networkAdapterResources; + + public void callNetworkAdapter (DelegateExecution execution) { + try { + Object networkAdapterRequest = execution.getVariable(NETWORK_REQUEST); + if (networkAdapterRequest != null) { + Optional<Response> response = Optional.empty(); + if (networkAdapterRequest instanceof CreateNetworkRequest) { + CreateNetworkRequest createNetworkRequest = (CreateNetworkRequest) networkAdapterRequest; + execution.setVariable(NETWORK_CORRELATOR, createNetworkRequest.getMessageId()); + response = networkAdapterResources.createNetworkAsync(createNetworkRequest); + } else if (networkAdapterRequest instanceof DeleteNetworkRequest) { + DeleteNetworkRequest deleteNetworkRequest = (DeleteNetworkRequest) networkAdapterRequest; + execution.setVariable(NETWORK_CORRELATOR, deleteNetworkRequest.getMessageId()); + response = networkAdapterResources.deleteNetworkAsync(deleteNetworkRequest); + } + if(response.isPresent()) { + String statusCode = Integer.toString(response.get().getStatus()); + String responseString = ""; + if(response.get().getEntity() != null) { + responseString = (String) response.get().getEntity(); + } + execution.setVariable(NETWORK_SYNC_CODE, statusCode); + execution.setVariable(NETWORK_SYNC_RESPONSE, responseString); + } else { + throw new Exception("No Ack response from Openstack Adapter"); + } + } else { + throw new Exception("No Network Request was created. networkAdapterRequest was null."); + } + } catch (Exception ex) { + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex.getStackTrace().toString()); + } + } + + public void processCallback (DelegateExecution execution) { + try { + Object networkAdapterRequest = execution.getVariable(NETWORK_REQUEST); + String callback = (String) execution.getVariable(NETWORK_MESSAGE); + String logCallbackMessage = "Callback from OpenstackAdapter: " + callback; + logger.debug(logCallbackMessage); + if (networkAdapterRequest != null) { + if (networkAdapterRequest instanceof CreateNetworkRequest) { + if(callback.contains("createNetworkError")) { + CreateNetworkError createNetworkError = (CreateNetworkError) unmarshalXml(callback, CreateNetworkError.class); + throw new Exception(createNetworkError.getMessage()); + } else { + CreateNetworkResponse createNetworkResponse = (CreateNetworkResponse) unmarshalXml(callback, CreateNetworkResponse.class); + execution.setVariable("createNetworkResponse", createNetworkResponse); + } + } else if (networkAdapterRequest instanceof DeleteNetworkRequest) { + if(callback.contains("deleteNetworkError")) { + DeleteNetworkError deleteNetworkError = (DeleteNetworkError) unmarshalXml(callback, DeleteNetworkError.class); + throw new Exception(deleteNetworkError.getMessage()); + } else { + DeleteNetworkResponse deleteNetworkResponse = (DeleteNetworkResponse) unmarshalXml(callback, DeleteNetworkResponse.class); + execution.setVariable("deleteNetworkResponse", deleteNetworkResponse); + } + } + } + } catch (Exception e) { + logger.error("Error in Openstack Adapter callback", e); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getMessage()); + } + } + + protected <T> Object unmarshalXml(String xmlString, Class<T> resultClass) throws JAXBException { + StringReader reader = new StringReader(xmlString); + JAXBContext context = JAXBContext.newInstance(resultClass); + Unmarshaller unmarshaller = context.createUnmarshaller(); + return unmarshaller.unmarshal(reader); + } + + public void handleTimeOutException (DelegateExecution execution) { + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Error timed out waiting on Openstack Async-Response"); + } + + public void handleSyncError (DelegateExecution execution) { + String statusCode = (String) execution.getVariable(NETWORK_SYNC_CODE); + String responseString = (String) execution.getVariable(NETWORK_SYNC_RESPONSE); + String errorMessage = "Error with Openstack Adapter Sync Request: StatusCode = " + statusCode + " Response = " + responseString; + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, errorMessage); + } +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java index 173d5f7e73..a4ef28496e 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCRequestTasks.java @@ -21,7 +21,6 @@ package org.onap.so.bpmn.infrastructure.sdnc.tasks; import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.so.bpmn.core.WorkflowException; import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.exception.MapperException; @@ -31,6 +30,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.web.client.HttpClientErrorException; import com.jayway.jsonpath.JsonPath; import com.jayway.jsonpath.PathNotFoundException; @@ -64,15 +64,18 @@ public class SDNCRequestTasks { String finalMessageIndicator = JsonPath.read(response, "$.output.ack-final-indicator"); execution.setVariable("isSDNCCompleted", convertIndicatorToBoolean(finalMessageIndicator)); } catch(PathNotFoundException e) { - logger.error("Error Parsing SDNC Response", e); - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,"Error Parsing SDNC Response"); + logger.error("Error Parsing SDNC Response. Could not find read final ack indicator from JSON.", e); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,"Recieved invalid response from SDNC, unable to read message content."); } catch (MapperException e) { - logger.error("Error Parsing SDNC Response", e); - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,"Error Parsing SDNC Response"); + logger.error("Failed to map SDNC object to JSON prior to POST.", e); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000,"Failed to map SDNC object to JSON prior to POST."); } catch (BadResponseException e) { - logger.error("Error Reading SDNC Response", e); - exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "Error Reading SDNC Response"); - } + logger.error("Did not receive a successful response from SDNC.", e); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e.getLocalizedMessage()); + } catch (HttpClientErrorException e){ + logger.error("HttpClientErrorException: 404 Not Found, Failed to contact SDNC", e); + exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, "SDNC cannot be contacted."); + } } public void processCallback (DelegateExecution execution) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 50f2091ae2..d18fd006f4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -109,7 +109,9 @@ public class WorkflowAction { private static final String USERPARAMSERVICE = "service"; private static final String supportedTypes = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances"; private static final String HOMINGSOLUTION = "Homing_Solution"; - private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; + private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; + private static final String G_SERVICE_TYPE = "serviceType"; + private static final String SERVICE_TYPE_TRANSPORT = "TRANSPORT"; private static final Logger logger = LoggerFactory.getLogger(WorkflowAction.class); @Autowired @@ -146,6 +148,8 @@ public class WorkflowAction { final String uri = (String) execution.getVariable(G_URI); final String vnfType = (String) execution.getVariable(VNF_TYPE); String serviceInstanceId = (String) execution.getVariable("serviceInstanceId"); + final String serviceType = Optional.ofNullable((String) execution.getVariable(G_SERVICE_TYPE)).orElse(""); + List<OrchestrationFlow> orchFlows = (List<OrchestrationFlow>) execution.getVariable(G_ORCHESTRATION_FLOW); List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>(); WorkflowResourceIds workflowResourceIds = populateResourceIdsFromApiHandler(execution); @@ -192,7 +196,7 @@ public class WorkflowAction { if (aLaCarte) { if (orchFlows == null || orchFlows.isEmpty()) { - orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner); + orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner, serviceType); } orchFlows = filterOrchFlows(orchFlows, resourceType, execution); String key = ""; @@ -277,7 +281,7 @@ public class WorkflowAction { logger.info("Found {}", foundObjects); if (orchFlows == null || orchFlows.isEmpty()) { - orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner); + orchFlows = queryNorthBoundRequestCatalogDb(execution, requestAction, resourceType, aLaCarte, cloudOwner, serviceType); } flowsToExecute = buildExecuteBuildingBlockList(orchFlows, resourceCounter, requestId, apiVersion, resourceId, resourceType, requestAction, aLaCarte, vnfType, workflowResourceIds, requestDetails); @@ -1054,9 +1058,21 @@ public class WorkflowAction { protected List<OrchestrationFlow> queryNorthBoundRequestCatalogDb(DelegateExecution execution, String requestAction, WorkflowType resourceName, boolean aLaCarte, String cloudOwner) { + return this.queryNorthBoundRequestCatalogDb(execution, requestAction, resourceName, aLaCarte, cloudOwner, ""); + } + + protected List<OrchestrationFlow> queryNorthBoundRequestCatalogDb(DelegateExecution execution, String requestAction, + WorkflowType resourceName, boolean aLaCarte, String cloudOwner, String serviceType) { List<OrchestrationFlow> listToExecute = new ArrayList<>(); - NorthBoundRequest northBoundRequest = catalogDbClient - .getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(requestAction, resourceName.toString(), aLaCarte, cloudOwner); + NorthBoundRequest northBoundRequest = null; + if (serviceType.equalsIgnoreCase(SERVICE_TYPE_TRANSPORT)) { + northBoundRequest = catalogDbClient + .getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType(requestAction, + resourceName.toString(), aLaCarte, cloudOwner, serviceType); + } else { + northBoundRequest = catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner( + requestAction, resourceName.toString(), aLaCarte, cloudOwner); + } if(northBoundRequest == null){ if(aLaCarte){ buildAndThrowException(execution,"The request: ALaCarte " + resourceName + " " + requestAction + " is not supported by GR_API."); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java index 4fb480892a..1812e50328 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java @@ -25,6 +25,7 @@ import java.util.Optional; import org.camunda.bpm.engine.delegate.BpmnError; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.onap.so.bpmn.core.WorkflowException; +import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.client.RequestsDbClient; import org.slf4j.Logger; @@ -67,7 +68,7 @@ public class WorkflowActionBBFailure { String errorMsg = ""; Boolean rollbackCompletedSuccessfully = (Boolean) execution.getVariable("isRollbackComplete"); Boolean isRollbackFailure = (Boolean) execution.getVariable("isRollback"); - + ExecuteBuildingBlock ebb = (ExecuteBuildingBlock) execution.getVariable("buildingBlock"); if(rollbackCompletedSuccessfully==null) rollbackCompletedSuccessfully = false; @@ -97,6 +98,17 @@ public class WorkflowActionBBFailure { request.setStatusMessage(errorMsg); execution.setVariable("ErrorMessage", errorMsg); } + if(ebb!=null && ebb.getBuildingBlock()!=null){ + String flowStatus = ""; + if(rollbackCompletedSuccessfully){ + flowStatus = "All Rollback flows have completed successfully"; + }else{ + flowStatus = ebb.getBuildingBlock().getBpmnFlowName() + " has failed."; + } + request.setFlowStatus(flowStatus); + execution.setVariable("flowStatus", flowStatus); + } + request.setProgress(Long.valueOf(100)); request.setRequestStatus("FAILED"); request.setLastModifiedBy("CamundaBPMN"); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 917039b17b..78a84b1772 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -199,6 +199,7 @@ public class WorkflowActionBBTasks { execution.setVariable("finalStatusMessage", macroAction); Timestamp endTime = new Timestamp(System.currentTimeMillis()); request.setEndTime(endTime); + request.setFlowStatus("Successfully completed all Building Blocks"); request.setStatusMessage(macroAction); request.setProgress(Long.valueOf(100)); request.setRequestStatus("COMPLETE"); @@ -269,7 +270,7 @@ public class WorkflowActionBBTasks { int flowSize = rollbackFlows.size(); String handlingCode = (String) execution.getVariable("handlingCode"); if(handlingCode.equals("RollbackToAssigned")){ - for(int i = 0; i<flowSize -1; i++){ + for(int i = 0; i<flowSize; i++){ if(rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Unassign")){ rollbackFlows.remove(i); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java index 45f28df756..cdb24401b3 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClient.java @@ -20,6 +20,8 @@ package org.onap.so.client.adapter.network; +import javax.ws.rs.core.Response; + import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.adapters.nwrest.DeleteNetworkRequest; @@ -44,4 +46,10 @@ public interface NetworkAdapterClient { UpdateNetworkResponse updateNetwork(String aaiNetworkId, UpdateNetworkRequest req) throws NetworkAdapterClientException; + + Response createNetworkAsync(CreateNetworkRequest req) throws NetworkAdapterClientException; + + Response deleteNetworkAsync(String aaiNetworkId, DeleteNetworkRequest req) throws NetworkAdapterClientException; + + Response rollbackNetworkAsync(String aaiNetworkId, RollbackNetworkRequest req) throws NetworkAdapterClientException; } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java index 9b052b4484..7092fe04c6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/NetworkAdapterClientImpl.java @@ -22,6 +22,7 @@ package org.onap.so.client.adapter.network; import javax.ws.rs.InternalServerErrorException; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import javax.ws.rs.core.UriBuilder; import org.onap.so.adapters.nwrest.CreateNetworkRequest; @@ -54,6 +55,15 @@ public class NetworkAdapterClientImpl implements NetworkAdapterClient { throw new NetworkAdapterClientException(e.getMessage()); } } + + @Override + public Response createNetworkAsync(CreateNetworkRequest req) throws NetworkAdapterClientException{ + try { + return new AdapterRestClient(this.props, this.getUri("").build()).post(req); + } catch (InternalServerErrorException e) { + throw new NetworkAdapterClientException(e.getMessage()); + } + } @Override public DeleteNetworkResponse deleteNetwork(String aaiNetworkId, DeleteNetworkRequest req) throws NetworkAdapterClientException { @@ -64,6 +74,15 @@ public class NetworkAdapterClientImpl implements NetworkAdapterClient { throw new NetworkAdapterClientException(e.getMessage()); } } + + @Override + public Response deleteNetworkAsync(String aaiNetworkId, DeleteNetworkRequest req) throws NetworkAdapterClientException { + try { + return new AdapterRestClient(this.props, this.getUri("/" + aaiNetworkId).build()).delete(req); + } catch (InternalServerErrorException e) { + throw new NetworkAdapterClientException(e.getMessage()); + } + } @Override public RollbackNetworkResponse rollbackNetwork(String aaiNetworkId, RollbackNetworkRequest req) throws NetworkAdapterClientException { @@ -74,6 +93,15 @@ public class NetworkAdapterClientImpl implements NetworkAdapterClient { throw new NetworkAdapterClientException(e.getMessage()); } } + + @Override + public Response rollbackNetworkAsync(String aaiNetworkId, RollbackNetworkRequest req) throws NetworkAdapterClientException { + try { + return new AdapterRestClient(this.props, this.getUri("/" + aaiNetworkId).build()).delete(req); + } catch (InternalServerErrorException e) { + throw new NetworkAdapterClientException(e.getMessage()); + } + } @Override public QueryNetworkResponse queryNetwork(String aaiNetworkId, String cloudSiteId, String tenantId, diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java index 3081ab86d8..794314bf8c 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java @@ -27,6 +27,7 @@ import java.util.Map; import java.util.Optional; import java.util.UUID; +import org.apache.commons.lang3.StringUtils; import org.modelmapper.ModelMapper; import org.modelmapper.PropertyMap; import org.onap.so.adapters.nwrest.ContrailNetwork; @@ -106,8 +107,7 @@ public class NetworkAdapterObjectMapper { String messageId = getRandomUuid(); createNetworkRequest.setMessageId(messageId); - //TODO clarify callback URL build process - //createNetworkRequest.setNotificationUrl(createCallbackUrl("NetworkAResponse", messageId)); + createNetworkRequest.setNotificationUrl(createCallbackUrl("NetworkAResponse", messageId)); return createNetworkRequest; } @@ -137,11 +137,18 @@ public class NetworkAdapterObjectMapper { deleteNetworkRequest.setMsoRequest(createMsoRequest(requestContext, serviceInstance)); deleteNetworkRequest.setNetworkId(l3Network.getNetworkId()); - deleteNetworkRequest.setNetworkStackId(l3Network.getHeatStackId()); + if (!StringUtils.isEmpty(l3Network.getHeatStackId())){ + deleteNetworkRequest.setNetworkStackId(l3Network.getHeatStackId()); + } + else { + deleteNetworkRequest.setNetworkStackId(l3Network.getNetworkName()); + } deleteNetworkRequest.setNetworkType(l3Network.getNetworkType()); deleteNetworkRequest.setSkipAAI(true); deleteNetworkRequest.setTenantId(cloudRegion.getTenantId()); + deleteNetworkRequest.setNotificationUrl(createCallbackUrl("NetworkAResponse", messageId)); + return deleteNetworkRequest; } @@ -187,11 +194,10 @@ public class NetworkAdapterObjectMapper { return updateNetworkRequest; } - private RollbackNetworkRequest setCommonRollbackRequestFields(RollbackNetworkRequest request,RequestContext requestContext){ - //TODO confirm flag value + private RollbackNetworkRequest setCommonRollbackRequestFields(RollbackNetworkRequest request,RequestContext requestContext) throws UnsupportedEncodingException{ request.setSkipAAI(true); - request.setMessageId(requestContext.getMsoRequestId()); - //TODO clarify callback URL build process. This will also set SYNC flag + String messageId = requestContext.getMsoRequestId(); + request.setMessageId(messageId); //request.setNotificationUrl(createCallbackUrl("NetworkAResponse", messageId)); return request; } @@ -365,4 +371,4 @@ public class NetworkAdapterObjectMapper { updateNetworkRequest.setBackout(Boolean.TRUE.equals(orchestrationContext.getIsRollbackEnabled())); //NetworkTechnology(NetworkTechnology.NEUTRON); NOOP - default } -} +}
\ No newline at end of file diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java index 64a86fc731..feb6ed4013 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/NetworkAdapterResources.java @@ -24,6 +24,8 @@ import java.io.UnsupportedEncodingException; import java.util.Map; import java.util.Optional; +import javax.ws.rs.core.Response; + import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.adapters.nwrest.DeleteNetworkRequest; @@ -79,4 +81,29 @@ public class NetworkAdapterResources { DeleteNetworkRequest deleteNetworkRequest = networkAdapterObjectMapper.deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); return Optional.of(networkAdapterClient.deleteNetwork(l3Network.getNetworkId(), deleteNetworkRequest)); } + + public Optional<Response> createNetworkAsync(CreateNetworkRequest createNetworkRequest) throws UnsupportedEncodingException, NetworkAdapterClientException { + + return Optional.of(networkAdapterClient.createNetworkAsync(createNetworkRequest)); + } + + public Optional<Response> deleteNetworkAsync(DeleteNetworkRequest deleteNetworkRequest) throws UnsupportedEncodingException, NetworkAdapterClientException { + + return Optional.of(networkAdapterClient.deleteNetworkAsync(deleteNetworkRequest.getNetworkId(), deleteNetworkRequest)); + } + + public Optional<RollbackNetworkResponse> rollbackCreateNetwork(String networkId, RollbackNetworkRequest rollbackNetworkRequest) throws UnsupportedEncodingException, NetworkAdapterClientException { + + return Optional.of(networkAdapterClient.rollbackNetwork(networkId, rollbackNetworkRequest)); + } + + public Optional<UpdateNetworkResponse> updateNetwork(UpdateNetworkRequest updateNetworkRequest) throws UnsupportedEncodingException, NetworkAdapterClientException { + + return Optional.of(networkAdapterClient.updateNetwork(updateNetworkRequest.getNetworkId(), updateNetworkRequest)); + } + + public Optional<DeleteNetworkResponse> deleteNetwork(DeleteNetworkRequest deleteNetworkRequest) throws UnsupportedEncodingException, NetworkAdapterClientException { + + return Optional.of(networkAdapterClient.deleteNetwork(deleteNetworkRequest.getNetworkId(), deleteNetworkRequest)); + } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java index 7d92a5304a..7ad2ef00b2 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sdnc/SDNCClient.java @@ -21,7 +21,6 @@ package org.onap.so.client.sdnc; import java.util.LinkedHashMap; -import java.util.Optional; import javax.ws.rs.core.UriBuilder; @@ -36,9 +35,6 @@ import org.springframework.core.ParameterizedTypeReference; import org.springframework.http.HttpHeaders; import org.springframework.stereotype.Component; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - @Component public class SDNCClient { @@ -49,6 +45,7 @@ public class SDNCClient { private SDNCProperties properties; @Autowired private SdnCommonTasks sdnCommonTasks; + /** * * @param request @@ -59,13 +56,13 @@ public class SDNCClient { * @throws BadResponseException */ public String post(Object request, SDNCTopology topology) throws MapperException, BadResponseException { - String jsonRequest = sdnCommonTasks.buildJsonRequest(request); - String targetUrl = properties.getHost() + properties.getPath() + ":" + topology.toString() + "/"; - STOClient.setTargetUrl(targetUrl); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); - STOClient.setHttpHeader(httpHeader); - LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); - return sdnCommonTasks.validateSDNResponse(output); + String jsonRequest = sdnCommonTasks.buildJsonRequest(request); + String targetUrl = properties.getHost() + properties.getPath() + ":" + topology.toString() + "/"; + STOClient.setTargetUrl(targetUrl); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + STOClient.setHttpHeader(httpHeader); + LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); + return sdnCommonTasks.validateSDNResponse(output); } @@ -76,9 +73,8 @@ public class SDNCClient { STOClient.setHttpHeader(httpHeader); LinkedHashMap<String, Object> output = STOClient.post(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); return sdnCommonTasks.validateSDNResponse(output); -} + } - /** * * @param queryLink @@ -90,15 +86,14 @@ public class SDNCClient { * @throws BadResponseException */ public String get(String queryLink) throws MapperException, BadResponseException { - - String request = ""; - String jsonRequest = sdnCommonTasks.buildJsonRequest(request); - String targetUrl = UriBuilder.fromUri(properties.getHost()).path(queryLink).build().toString(); - STOClient.setTargetUrl(targetUrl); - HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); - STOClient.setHttpHeader(httpHeader); - LinkedHashMap<String, Object> output = STOClient.get(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); - return sdnCommonTasks.validateSDNGetResponse(output); + String request = ""; + String jsonRequest = sdnCommonTasks.buildJsonRequest(request); + String targetUrl = UriBuilder.fromUri(properties.getHost()).path(queryLink).build().toString(); + STOClient.setTargetUrl(targetUrl); + HttpHeaders httpHeader = sdnCommonTasks.getHttpHeaders(properties.getAuth()); + STOClient.setHttpHeader(httpHeader); + LinkedHashMap<String, Object> output = STOClient.get(jsonRequest, new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {}); + return sdnCommonTasks.validateSDNGetResponse(output); } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java index 3dc03b2988..3034f0bd67 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterCreateTasksTest.java @@ -20,7 +20,9 @@ package org.onap.so.bpmn.infrastructure.adapter.network.tasks; +import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; @@ -33,6 +35,7 @@ import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; +import org.onap.so.adapters.nwrest.CreateNetworkRequest; import org.onap.so.adapters.nwrest.CreateNetworkResponse; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; @@ -76,17 +79,14 @@ public class NetworkAdapterCreateTasksTest extends BaseTaskTest{ @Test public void createNetworkTest() throws Exception { - CreateNetworkResponse createNetworkResponse = new CreateNetworkResponse(); - createNetworkResponse.setNetworkStackId("networkStackId"); - createNetworkResponse.setNetworkCreated(true); - Optional<CreateNetworkResponse> oCreateNetworkResponse = Optional.of(createNetworkResponse); - String cloudRegionPo = "cloudRegionPo"; + CreateNetworkRequest createNetworkRequest = new CreateNetworkRequest(); execution.setVariable("cloudRegionPo", cloudRegionPo); - doReturn(oCreateNetworkResponse).when(networkAdapterResources).createNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo,customer); + doReturn(createNetworkRequest).when(networkAdapterObjectMapper).createNetworkRequestMapper(isA(RequestContext.class), isA(CloudRegion.class), isA(OrchestrationContext.class), isA(ServiceInstance.class), isA(L3Network.class), isA(Map.class), isA(String.class), isA(Customer.class)); networkAdapterCreateTasks.createNetwork(execution); - verify(networkAdapterResources, times(1)).createNetwork(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo,customer); + verify(networkAdapterObjectMapper, times(1)).createNetworkRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo, customer); + assertEquals(createNetworkRequest, execution.getVariable("networkAdapterRequest")); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasksTest.java index 33a2e6a7a8..5b534e00e7 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterDeleteTasksTest.java @@ -20,10 +20,8 @@ package org.onap.so.bpmn.infrastructure.adapter.network.tasks; -import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.times; @@ -31,7 +29,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import java.io.UnsupportedEncodingException; -import java.util.Optional; import org.camunda.bpm.engine.delegate.BpmnError; import org.junit.Before; @@ -39,17 +36,16 @@ import org.junit.Test; import org.mockito.ArgumentMatchers; import org.mockito.InjectMocks; import org.mockito.Mock; -import org.onap.so.adapters.nwrest.DeleteNetworkResponse; +import org.onap.so.adapters.nwrest.DeleteNetworkRequest; import org.onap.so.bpmn.BaseTaskTest; import org.onap.so.bpmn.common.BuildingBlockExecution; import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; import org.onap.so.bpmn.servicedecomposition.bbobjects.L3Network; -import org.onap.so.client.adapter.network.NetworkAdapterClientException; -import org.onap.so.client.exception.BBObjectNotFoundException; -import org.onap.so.client.orchestration.NetworkAdapterResources; import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; +import org.onap.so.client.adapter.network.NetworkAdapterClientException; +import org.onap.so.client.exception.BBObjectNotFoundException; public class NetworkAdapterDeleteTasksTest extends BaseTaskTest{ @@ -77,25 +73,19 @@ public class NetworkAdapterDeleteTasksTest extends BaseTaskTest{ @Test public void test_deleteNetwork() throws UnsupportedEncodingException, NetworkAdapterClientException { - DeleteNetworkResponse deleteNetworkResponse = new DeleteNetworkResponse(); - deleteNetworkResponse.setNetworkDeleted(true); - deleteNetworkResponse.setNetworkId(l3Network.getNetworkId()); - Optional<DeleteNetworkResponse> oDeleteNetworkResponse = Optional.of(deleteNetworkResponse); - - when(networkAdapterResources.deleteNetwork(any(RequestContext.class), any(CloudRegion.class), eq(serviceInstance), eq(l3Network))).thenReturn(oDeleteNetworkResponse); + DeleteNetworkRequest deleteNetworkRequest = new DeleteNetworkRequest(); + doReturn(deleteNetworkRequest).when(networkAdapterObjectMapper).deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); networkAdapterDeleteTasks.deleteNetwork(execution); - - verify(networkAdapterResources, times(1)).deleteNetwork(requestContext, cloudRegion, serviceInstance, l3Network); - assertEquals(deleteNetworkResponse, execution.getVariable("deleteNetworkResponse")); + verify(networkAdapterObjectMapper, times(1)).deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); } @Test public void test_deleteNetwork_exception() throws UnsupportedEncodingException, NetworkAdapterClientException { expectedException.expect(BpmnError.class); - doThrow(NetworkAdapterClientException.class).when(networkAdapterResources). - deleteNetwork(any(RequestContext.class), any(CloudRegion.class), any(ServiceInstance.class), eq(l3Network)); + doThrow(RuntimeException.class).when(networkAdapterObjectMapper). + deleteNetworkRequestMapper(any(RequestContext.class), any(CloudRegion.class), any(ServiceInstance.class), eq(l3Network)); networkAdapterDeleteTasks.deleteNetwork(execution); } } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java new file mode 100644 index 0000000000..2ba8cb4b57 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java @@ -0,0 +1,19 @@ +package org.onap.so.bpmn.infrastructure.adapter.network.tasks; + +import java.io.IOException; + +import javax.xml.bind.JAXBException; + +import org.junit.Test; +import org.onap.so.adapters.nwrest.CreateNetworkResponse; + +public class NetworkAdapterRestV1Test { + + @Test + public void testUnmarshalXml() throws IOException, JAXBException { + String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><createNetworkResponse><messageId>ec37c121-e3ec-4697-8adf-2d7dca7044fc</messageId><networkCreated>true</networkCreated><networkFqdn>someNetworkFqdn</networkFqdn><networkId>991ec7bf-c9c4-4ac1-bb9c-4b61645bddb3</networkId><networkStackId>someStackId</networkStackId><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><rollback><cloudId>someCloudId</cloudId><modelCustomizationUuid>b7171cdd-8b05-459b-80ef-2093150e8983</modelCustomizationUuid><msoRequest><requestId>90b32315-176e-4dab-bcf1-80eb97a1c4f4</requestId><serviceInstanceId>71e7db22-7907-4d78-8fcc-8d89d28e90be</serviceInstanceId></msoRequest><networkCreated>true</networkCreated><networkStackId>someStackId</networkStackId><networkType>SomeNetworkType</networkType><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><tenantId>b60da4f71c1d4b35b8113d4eca6deaa1</tenantId></rollback><subnetMap><entry><key>6b381fa9-48ce-4e16-9978-d75309565bb6</key><value>bc1d5537-860b-4894-8eba-6faff41e648c</value></entry></subnetMap></createNetworkResponse>"; + CreateNetworkResponse response = (CreateNetworkResponse) new NetworkAdapterRestV1().unmarshalXml(xml, CreateNetworkResponse.class); + String returnedXml = response.toXmlString(); + System.out.println(returnedXml); + } +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index 5c1485979e..f3b094f645 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -21,9 +21,9 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; import static org.junit.Assert.assertEquals; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.mockito.Matchers.isA; +import static org.mockito.ArgumentMatchers.anyObject; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.when; @@ -258,33 +258,28 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { List<ExecuteBuildingBlock> flowsToExecute = new ArrayList(); ExecuteBuildingBlock ebb1 = new ExecuteBuildingBlock(); BuildingBlock bb1 = new BuildingBlock(); - bb1.setBpmnFlowName("AssignServiceInstanceBB"); + bb1.setBpmnFlowName("AssignVfModuleBB"); ebb1.setBuildingBlock(bb1); flowsToExecute.add(ebb1); ExecuteBuildingBlock ebb2 = new ExecuteBuildingBlock(); BuildingBlock bb2 = new BuildingBlock(); - bb2.setBpmnFlowName("CreateNetworkCollectionBB"); + bb2.setBpmnFlowName("CreateVfModuleBB"); ebb2.setBuildingBlock(bb2); flowsToExecute.add(ebb2); ExecuteBuildingBlock ebb3 = new ExecuteBuildingBlock(); BuildingBlock bb3 = new BuildingBlock(); - bb3.setBpmnFlowName("AssignNetworkBB"); + bb3.setBpmnFlowName("ActivateVfModuleBB"); ebb3.setBuildingBlock(bb3); flowsToExecute.add(ebb3); - ExecuteBuildingBlock ebb4 = new ExecuteBuildingBlock(); - BuildingBlock bb4 = new BuildingBlock(); - bb4.setBpmnFlowName("CreateNetworkBB"); - ebb4.setBuildingBlock(bb4); - flowsToExecute.add(ebb4); execution.setVariable("flowsToExecute", flowsToExecute); - execution.setVariable("gCurrentSequence", 3); - doNothing().when(workflowActionBBFailure).updateRequestErrorStatusMessage(isA(DelegateExecution.class)); - + execution.setVariable("gCurrentSequence", 2); + workflowActionBBTasks.rollbackExecutionPath(execution); List<ExecuteBuildingBlock> ebbs = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); - assertEquals(ebbs.get(0).getBuildingBlock().getBpmnFlowName(),"DeleteNetworkCollectionBB"); + assertEquals("DeleteVfModuleBB",ebbs.get(0).getBuildingBlock().getBpmnFlowName()); assertEquals(0,execution.getVariable("gCurrentSequence")); + assertEquals(1,ebbs.size()); } @Test diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java index 72f0ce4e6d..7b348c8cb3 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionTest.java @@ -982,6 +982,17 @@ public class WorkflowActionTest extends BaseTaskTest { assertEquals(flows.get(8).getFlowName(),"SDNOVnfHealthCheckBB"); assertEquals(flows.get(9).getFlowName(),"AAIUnsetVnfInMaintBB"); } + + @Test + public void queryNorthBoundRequestCatalogDbTransportTest() throws MalformedURLException { + NorthBoundRequest northBoundRequest = new NorthBoundRequest(); + List<OrchestrationFlow> orchFlows = createFlowList("AssignServiceInstanceBB"); + northBoundRequest.setOrchestrationFlowList(orchFlows); + when(catalogDbClient.getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType("createInstance","Service",true,"my-custom-cloud-owner","TRANSPORT")).thenReturn(northBoundRequest); + + List<OrchestrationFlow> flows = workflowAction.queryNorthBoundRequestCatalogDb(execution, "createInstance", WorkflowType.SERVICE, true,"my-custom-cloud-owner","TRANSPORT"); + assertEquals(flows.get(0).getFlowName(),"AssignServiceInstanceBB"); + } @Test public void extractResourceIdAndTypeFromUriTest(){ diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java index 4008240203..297d75a104 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionUnitTest.java @@ -144,7 +144,7 @@ public class WorkflowActionUnitTest { flow.setFlowName("flow x"); List<OrchestrationFlow> flows = Arrays.asList(flow); - doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean(), any()); + doReturn(Arrays.asList(flow)).when(workflowAction).queryNorthBoundRequestCatalogDb(any(), any(), any(), anyBoolean(), any(), any()); workflowAction.selectExecutionList(execution); verify(workflowAction, times(1)).filterOrchFlows(eq(flows), any(), any()); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java index 6f353fa622..1a86d713a2 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapperTest.java @@ -22,6 +22,7 @@ package org.onap.so.client.adapter.network.mapper; import static com.shazam.shazamcrest.MatcherAssert.assertThat; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.*; +import static org.mockito.Matchers.isA; import static org.mockito.Mockito.doReturn; import java.io.UnsupportedEncodingException; @@ -135,6 +136,8 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{ expectedCreateNetworkRequest.setMsoRequest(msoRequest); expectedCreateNetworkRequest.setSkipAAI(true); + expectedCreateNetworkRequest.setNotificationUrl("endpoint/NetworkAResponse/messageId"); + Subnet openstackSubnet = new Subnet(); HostRoute hostRoute = new HostRoute(); hostRoute.setHostRouteId("hostRouteId"); @@ -146,6 +149,9 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{ l3Network.getSubnets().add(openstackSubnet); l3Network.setNetworkTechnology("Contrail"); + doReturn("endpoint/").when(SPY_networkAdapterObjectMapper).getEndpoint(); + doReturn("messageId").when(SPY_networkAdapterObjectMapper).getRandomUuid(); + CreateNetworkRequest createNetworkRequest = SPY_networkAdapterObjectMapper.createNetworkRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, l3Network, userInput, cloudRegionPo, customer); assertThat(createNetworkRequest, sameBeanAs(expectedCreateNetworkRequest).ignoring("contrailRequest").ignoring("contrailNetwork").ignoring("providerVlanNetwork").ignoring("subnets").ignoring("networkParams").ignoring("messageId")); @@ -295,6 +301,51 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{ expectedDeleteNetworkRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId()); + expectedDeleteNetworkRequest.setNotificationUrl("endpoint/NetworkAResponse/messageId"); + + doReturn("endpoint/").when(SPY_networkAdapterObjectMapper).getEndpoint(); + doReturn("messageId").when(SPY_networkAdapterObjectMapper).getRandomUuid(); + + DeleteNetworkRequest deleteNetworkRequest = SPY_networkAdapterObjectMapper.deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); + + assertThat(expectedDeleteNetworkRequest, sameBeanAs(deleteNetworkRequest)); + } + + @Test + public void deleteNetworkRequestNoHeatIdMapperTest() throws Exception { + DeleteNetworkRequest expectedDeleteNetworkRequest = new DeleteNetworkRequest(); + + String messageId = "messageId"; + expectedDeleteNetworkRequest.setMessageId(messageId); + doReturn(messageId).when(SPY_networkAdapterObjectMapper).getRandomUuid(); + + ModelInfoNetwork modelInfoNetwork = new ModelInfoNetwork(); + l3Network.setModelInfoNetwork(modelInfoNetwork); + modelInfoNetwork.setModelCustomizationUUID("modelCustomizationUuid"); + expectedDeleteNetworkRequest.setModelCustomizationUuid(modelInfoNetwork.getModelCustomizationUUID()); + + MsoRequest msoRequest = new MsoRequest(); + msoRequest.setRequestId(requestContext.getMsoRequestId()); + msoRequest.setServiceInstanceId(serviceInstance.getServiceInstanceId()); + expectedDeleteNetworkRequest.setMsoRequest(msoRequest); + + expectedDeleteNetworkRequest.setNetworkId(l3Network.getNetworkId()); + + l3Network.setNetworkName("heatStackId"); + expectedDeleteNetworkRequest.setNetworkStackId("heatStackId"); + + expectedDeleteNetworkRequest.setNetworkType(l3Network.getNetworkType()); + + expectedDeleteNetworkRequest.setSkipAAI(true); + + expectedDeleteNetworkRequest.setTenantId(cloudRegion.getTenantId()); + + expectedDeleteNetworkRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId()); + + expectedDeleteNetworkRequest.setNotificationUrl("endpoint/NetworkAResponse/messageId"); + + doReturn("endpoint/").when(SPY_networkAdapterObjectMapper).getEndpoint(); + doReturn("messageId").when(SPY_networkAdapterObjectMapper).getRandomUuid(); DeleteNetworkRequest deleteNetworkRequest = SPY_networkAdapterObjectMapper.deleteNetworkRequestMapper(requestContext, cloudRegion, serviceInstance, l3Network); assertThat(expectedDeleteNetworkRequest, sameBeanAs(deleteNetworkRequest)); @@ -316,6 +367,11 @@ public class NetworkAdapterObjectMapperTest extends TestDataSetup{ org.onap.so.adapters.nwrest.CreateNetworkRequest.class); String cloudRegionPo = "cloudRegionPo"; + + expectedCreateNetworkRequest.setNotificationUrl("endpoint/NetworkAResponse/messageId"); + + doReturn("endpoint/").when(SPY_networkAdapterObjectMapper).getEndpoint(); + doReturn("messageId").when(SPY_networkAdapterObjectMapper).getRandomUuid(); CreateNetworkRequest createNetworkRequest = SPY_networkAdapterObjectMapper.createNetworkRequestMapper(requestContext, cloudRegion, orchestrationContext, serviceInstance, myNetwork, userInput, cloudRegionPo, customer); //ignoring dynamic fields and networkParams that throws parsing exception on json file load assertThat(createNetworkRequest, sameBeanAs(expectedCreateNetworkRequest).ignoring("messageId").ignoring("msoRequest.requestId").ignoring("networkParams")); diff --git a/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java b/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java index ac6e939e9e..4f235c35f1 100644 --- a/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java +++ b/common/src/main/java/org/onap/so/client/aai/AAIRestClient.java @@ -20,25 +20,17 @@ package org.onap.so.client.aai; -import static org.mockito.Mockito.RETURNS_DEEP_STUBS; - import java.net.URI; -import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.regex.Pattern; import javax.ws.rs.core.Response; import org.onap.so.client.ResponseExceptionMapper; import org.onap.so.client.RestClientSSL; -import org.onap.so.client.graphinventory.exceptions.GraphInventoryPatchDepthExceededException; import org.onap.so.client.policy.CommonObjectMapperProvider; -import org.onap.so.jsonpath.JsonPathUtil; import org.onap.so.utils.TargetEntity; -import com.fasterxml.jackson.core.JsonProcessingException; - public class AAIRestClient extends RestClientSSL { private final AAIProperties aaiProperties; @@ -58,7 +50,7 @@ public class AAIRestClient extends RestClientSSL { @Override protected void initializeHeaderMap(Map<String, String> headerMap) { - headerMap.put("X-FromAppId", "MSO"); + headerMap.put("X-FromAppId", aaiProperties.getSystemName()); headerMap.put("X-TransactionId", requestId); String auth = aaiProperties.getAuth(); String key = aaiProperties.getKey(); diff --git a/common/src/main/java/org/onap/so/client/aai/AAIRestClientI.java b/common/src/main/java/org/onap/so/client/aai/AAIRestClientI.java index 785c82bb71..62d7d565ac 100644 --- a/common/src/main/java/org/onap/so/client/aai/AAIRestClientI.java +++ b/common/src/main/java/org/onap/so/client/aai/AAIRestClientI.java @@ -31,11 +31,11 @@ public interface AAIRestClientI { List<Pserver> getPhysicalServerByVnfId(String vnfId) throws IOException; - void updateMaintenceFlagVnfId(String vnfId, boolean inMaint) throws Exception; + void updateMaintenceFlagVnfId(String vnfId, boolean inMaint); GenericVnf getVnfByName(String vnfId); - Optional<Pnf> getPnfByName(String pnfId, String transactionLoggingUuid) throws Exception; + Optional<Pnf> getPnfByName(String pnfId); - void createPnf(String pnfId, String transactionLoggingUuid, Pnf pnf) throws IOException; + void createPnf(String pnfId, Pnf pnf); } diff --git a/common/src/main/java/org/onap/so/client/aai/AAIRestClientImpl.java b/common/src/main/java/org/onap/so/client/aai/AAIRestClientImpl.java index 1c02409b56..b2c7fcc062 100644 --- a/common/src/main/java/org/onap/so/client/aai/AAIRestClientImpl.java +++ b/common/src/main/java/org/onap/so/client/aai/AAIRestClientImpl.java @@ -80,7 +80,7 @@ public class AAIRestClientImpl implements AAIRestClientI { } @Override - public Optional<Pnf> getPnfByName(String pnfId, String transactionLoggingUuid) { + public Optional<Pnf> getPnfByName(String pnfId) { Response response = new AAIResourcesClient() .getFullResponse(AAIUriFactory.createResourceUri(AAIObjectType.PNF, pnfId)); if (response.getStatus() != 200) { @@ -91,7 +91,7 @@ public class AAIRestClientImpl implements AAIRestClientI { } @Override - public void createPnf(String pnfId, String transactionLoggingUuid, Pnf pnf) { + public void createPnf(String pnfId, Pnf pnf) { new AAIResourcesClient() .createIfNotExists(AAIUriFactory.createResourceUri(AAIObjectType.PNF, pnfId), Optional.of(pnf)); } diff --git a/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java b/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java index 19bbe69cf2..2b7a81d590 100644 --- a/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java +++ b/common/src/main/java/org/onap/so/client/grm/beans/ServiceEndPointList.java @@ -22,27 +22,21 @@ package org.onap.so.client.grm.beans; import java.util.List; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; @JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -@JsonPropertyOrder({ "serviceEndPointList" }) +//@JsonIgnoreProperties(ignoreUnknown = true) public class ServiceEndPointList { - @JsonProperty("serviceEndPointList") + @JsonAlias("ServiceEndPointList") private List<ServiceEndPoint> serviceEndPointList = null; - @JsonProperty("serviceEndPointList") public List<ServiceEndPoint> getServiceEndPointList() { return serviceEndPointList; } - @JsonProperty("serviceEndPointList") public void setServiceEndPointList(List<ServiceEndPoint> serviceEndPointList) { this.serviceEndPointList = serviceEndPointList; } - } diff --git a/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java b/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java index 5951928bf4..882a390c7b 100644 --- a/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java +++ b/common/src/main/java/org/onap/so/client/sdno/SDNOValidatorImpl.java @@ -77,17 +77,17 @@ public class SDNOValidatorImpl implements SDNOValidator { protected SDNO buildRequestDiagnostic(GenericVnf vnf, UUID uuid, String requestingUserId) { - Optional<String> vnfType; - if (vnf.getVnfType() == null) { - vnfType = Optional.empty(); + Optional<String> nfRole; + if (vnf.getNfRole() == null) { + nfRole = Optional.empty(); } else { - vnfType = Optional.of(vnf.getVnfType()); + nfRole = Optional.of(vnf.getNfRole()); } Input input = new Input(); SDNO parentRequest = new SDNO(); Body body = new Body(); parentRequest.setBody(body); - parentRequest.setNodeType(vnfType.orElse("NONE").toUpperCase()); + parentRequest.setNodeType(nfRole.orElse("NONE").toUpperCase()); parentRequest.setOperation("health-diagnostic"); body.setInput(input); @@ -97,6 +97,7 @@ public class SDNOValidatorImpl implements SDNOValidator { request.setRequestClientName(clientName); request.setRequestNodeName(vnf.getVnfName()); request.setRequestNodeUuid(vnf.getVnfId()); + request.setRequestNodeType(nfRole.orElse("NONE").toUpperCase()); request.setRequestNodeIp(vnf.getIpv4OamAddress()); //generic-vnf oam ip request.setRequestUserId(requestingUserId); //mech id? request.setRequestId(uuid.toString()); //something to identify this request by for polling diff --git a/common/src/main/java/org/onap/so/exceptions/ValidationException.java b/common/src/main/java/org/onap/so/exceptions/ValidationException.java index 713fac70f3..b91c30c598 100644 --- a/common/src/main/java/org/onap/so/exceptions/ValidationException.java +++ b/common/src/main/java/org/onap/so/exceptions/ValidationException.java @@ -32,9 +32,9 @@ public class ValidationException extends Exception { private static final long serialVersionUID = 1L; private static final String VALIDATION_FAIL = "No valid $ELEMENT is specified"; - private static final String INVALID_ELEMENT = "$ELEMENT is not valid in the $VERSION version"; + private static final String UNMATCHED_ELEMENTS = "$ELEMENT does not match $SECOND_ELEMENT"; private static final String REPLACE_ELEMENT_KEY = "\\$ELEMENT"; - private static final String REPLACE_VERSION_KEY = "\\$VERSION"; + private static final String REPLACE_SECOND_ELEMENT_KEY = "\\$SECOND_ELEMENT"; @Deprecated public ValidationException (String msg) { @@ -48,7 +48,7 @@ public class ValidationException extends Exception { public ValidationException (String msg, Exception cause) { super (VALIDATION_FAIL.replaceAll (REPLACE_ELEMENT_KEY, msg), cause); } - public ValidationException(String msg, String version) { - super(INVALID_ELEMENT.replaceAll(REPLACE_ELEMENT_KEY, msg).replaceAll(REPLACE_VERSION_KEY, version)); + public ValidationException(String firstElement, String secondElement) { + super(UNMATCHED_ELEMENTS.replaceAll(REPLACE_ELEMENT_KEY, firstElement).replaceAll(REPLACE_SECOND_ELEMENT_KEY, secondElement)); } -} +}
\ No newline at end of file diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java index 8e7e5e945e..d39efddf43 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Request.java @@ -22,6 +22,8 @@ package org.onap.so.serviceinstancebeans; import java.util.List; +import org.apache.commons.lang3.builder.ToStringBuilder; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude.Include; @@ -31,6 +33,7 @@ public class Request { protected String requestId; protected String startTime; + protected String finishTime; protected String requestScope; protected String requestType; protected RequestDetails requestDetails; @@ -51,6 +54,12 @@ public class Request { public void setStartTime(String startTime) { this.startTime = startTime; } + public String getFinishTime() { + return finishTime; + } + public void setFinishTime(String finishTime) { + this.finishTime = finishTime; + } public String getRequestScope() { return requestScope; } @@ -89,11 +98,9 @@ public class Request { } @Override public String toString() { - return "Request [requestId=" + requestId + ", startTime=" + startTime - + ", requestScope=" + requestScope + ", requestType=" + requestType - + ", requestDetails=" + requestDetails + ", instanceReferences=" + instanceReferences - + ", requestStatus=" + requestStatus + ", requestProcessingData=" + requestProcessingData + "]"; + return new ToStringBuilder(this).append("requestId", requestId).append("startTime", startTime) + .append("finishTime", finishTime).append("requestScope", requestScope).append("requestType", requestType) + .append("requestDetails", requestDetails).append("instanceReferences", instanceReferences) + .append("requestStatus", requestStatus).append("requestProcessingData", requestProcessingData).toString(); } - - } diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java index 8adce38ada..4c3597b2c1 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/RequestStatus.java @@ -30,7 +30,6 @@ public class RequestStatus { protected String requestState; protected String statusMessage; protected Integer percentProgress; - protected String finishTime; protected String timeStamp; @@ -52,12 +51,6 @@ public class RequestStatus { public void setPercentProgress(Integer percentProgress) { this.percentProgress = percentProgress; } - public String getFinishTime() { - return finishTime; - } - public void setFinishTime(String finishTime) { - this.finishTime = finishTime; - } public String getTimeStamp() { return timeStamp; } @@ -67,6 +60,6 @@ public class RequestStatus { @Override public String toString() { return new ToStringBuilder(this).append("requestState", requestState).append("statusMessage", statusMessage) - .append("percentProgress", percentProgress).append("finishTime", finishTime).append("timeStamp", timeStamp).toString(); + .append("percentProgress", percentProgress).append("timeStamp", timeStamp).toString(); } } diff --git a/common/src/test/java/org/onap/so/client/grm/ServiceEndPointListTest.java b/common/src/test/java/org/onap/so/client/grm/ServiceEndPointListTest.java index a1fb43ea5e..d0d0e6701b 100644 --- a/common/src/test/java/org/onap/so/client/grm/ServiceEndPointListTest.java +++ b/common/src/test/java/org/onap/so/client/grm/ServiceEndPointListTest.java @@ -58,6 +58,30 @@ public class ServiceEndPointListTest { assertEquals("DEV", se.getProperties().get(0).getValue()); } + @Test + public void testUnmarshallServiceEndpointListStartsWithUppercase() throws Exception { + String endpointsJson = getFileContentsAsString("__files/grm/endpoints2.json"); + ServiceEndPointList sel = mapper.readValue(endpointsJson, ServiceEndPointList.class); + + List<ServiceEndPoint> list = sel.getServiceEndPointList(); + ServiceEndPoint se = list.get(0); + + assertEquals(3, list.size()); + assertEquals("dummy.pod.ns.dummy-pod3", se.getName()); + assertEquals(Integer.valueOf(1), Integer.valueOf(se.getVersion().getMajor())); + assertEquals(Integer.valueOf(0), Integer.valueOf(se.getVersion().getMinor())); + assertEquals(Integer.valueOf(0), Integer.valueOf(se.getVersion().getPatch())); + assertEquals("192.168.120.218", se.getHostAddress()); + assertEquals("32004", se.getListenPort()); + assertEquals("37.7022", se.getLatitude()); + assertEquals("121.9358", se.getLongitude()); + assertEquals("/", se.getContextPath()); + assertEquals("edge", se.getOperationalInfo().getCreatedBy()); + assertEquals("edge", se.getOperationalInfo().getUpdatedBy()); + assertEquals("Environment", se.getProperties().get(0).getName()); + assertEquals("DEV", se.getProperties().get(0).getValue()); + } + protected String getFileContentsAsString(String fileName) { String content = ""; diff --git a/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorImplTest.java b/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorImplTest.java new file mode 100644 index 0000000000..79ce196bd3 --- /dev/null +++ b/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorImplTest.java @@ -0,0 +1,57 @@ +/*- + * ============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.sdno; + +import static org.junit.Assert.assertEquals; +import java.util.UUID; + +import org.junit.Test; +import org.onap.aai.domain.yang.GenericVnf; +import org.onap.so.client.sdno.beans.RequestHealthDiagnostic; +import org.onap.so.client.sdno.beans.SDNO; + +public class SDNOValidatorImplTest { + + @Test + public void buildRequestDiagnosticTest() throws Exception { + SDNOValidatorImpl validator = new SDNOValidatorImpl(); + UUID uuid = UUID.randomUUID(); + GenericVnf vnf = new GenericVnf(); + vnf.setVnfName("VNFNAME"); + vnf.setVnfId("test"); + vnf.setIpv4OamAddress("1.2.3.4"); + vnf.setNfRole("VPE"); + SDNO request = validator.buildRequestDiagnostic(vnf, uuid, "mechid"); + assertEquals(request.getNodeType(), "VPE"); + assertEquals(request.getOperation(), "health-diagnostic"); + + RequestHealthDiagnostic innerRequest = request.getBody().getInput().getRequestHealthDiagnostic(); + assertEquals(innerRequest.getRequestClientName(), "MSO"); + assertEquals(innerRequest.getRequestNodeName(), "VNFNAME"); + assertEquals(innerRequest.getRequestNodeUuid(), "test"); + assertEquals(innerRequest.getRequestNodeType(), "VPE"); + assertEquals(innerRequest.getRequestNodeIp(), "1.2.3.4"); + assertEquals(innerRequest.getRequestUserId(), "mechid"); + assertEquals(innerRequest.getRequestId(), uuid.toString()); + assertEquals(innerRequest.getHealthDiagnosticCode(), "default"); + + } +} diff --git a/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorTest.java b/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorTest.java index d66f5f64f7..9794c9b622 100644 --- a/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorTest.java +++ b/common/src/test/java/org/onap/so/client/sdno/SDNOValidatorTest.java @@ -100,7 +100,7 @@ public class SDNOValidatorTest { GenericVnf vnf = new GenericVnf(); vnf.setVnfId("test"); vnf.setIpv4OamAddress("1.2.3.4"); - vnf.setVnfType("VPE"); + vnf.setNfRole("VPE"); SDNO request = validator.buildRequestDiagnostic(vnf, uuid, "mechid"); ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(request); diff --git a/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java b/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java index b3ae7ba9f5..27fb584b3b 100644 --- a/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java +++ b/common/src/test/java/org/onap/so/exceptions/ValidationExceptionTest.java @@ -47,7 +47,7 @@ public class ValidationExceptionTest { @Test public void validationExceptionVersion(){ - ValidationException e = new ValidationException("testMessage", "1.0"); - Assert.assertEquals("testMessage is not valid in the 1.0 version", e.getMessage()); + ValidationException e = new ValidationException("testMessage", "secondTestMessage"); + Assert.assertEquals("testMessage does not match secondTestMessage", e.getMessage()); } } diff --git a/common/src/test/resources/__files/grm/endpoints2.json b/common/src/test/resources/__files/grm/endpoints2.json new file mode 100644 index 0000000000..7c9816ff55 --- /dev/null +++ b/common/src/test/resources/__files/grm/endpoints2.json @@ -0,0 +1,145 @@ +{ + "ServiceEndPointList": [ + { + "name": "dummy.pod.ns.dummy-pod3", + "version": { + "major": 1, + "minor": 0, + "patch": "0" + }, + "hostAddress": "192.168.120.218", + "listenPort": "32004", + "latitude": "37.7022", + "longitude": "121.9358", + "registrationTime": "2017-07-18T15:39:17.367+0000", + "expirationTime": "9999-10-09T15:39:17.368+0000", + "contextPath": "/", + "routeOffer": "DEFAULT", + "statusInfo": { + "status": "RUNNING" + }, + "eventStatusInfo": { + "status": "RUNNING" + }, + "validatorStatusInfo": { + "status": "RUNNING" + }, + "operationalInfo": { + "createdBy": "edge", + "updatedBy": "edge", + "createdTimestamp": "2017-07-18T15:39:17.367+0000", + "updatedTimestamp": "2017-07-18T15:39:17.367+0000" + }, + "protocol": "dummypod-port", + "properties": [ + { + "name": "Environment", + "value": "DEV" + }, + { + "name": "Kubernetes Namespace", + "value": "dummy-pod-ns" + }, + { + "name": "cpfrun_cluster_name", + "value": "CI-PDK1-TFINIT-CJ9125401" + } + ], + "disableType": [] + }, + { + "name": "dummy.pod.ns.dummy-pod3", + "version": { + "major": 1, + "minor": 0, + "patch": "0" + }, + "hostAddress": "192.168.120.22", + "listenPort": "32004", + "latitude": "1.0", + "longitude": "1.0", + "registrationTime": "2017-07-18T15:39:17.816+0000", + "expirationTime": "9999-10-09T15:39:17.817+0000", + "contextPath": "/", + "routeOffer": "DEFAULT", + "statusInfo": { + "status": "RUNNING" + }, + "eventStatusInfo": { + "status": "RUNNING" + }, + "validatorStatusInfo": { + "status": "RUNNING" + }, + "operationalInfo": { + "createdBy": "edge", + "updatedBy": "edge", + "createdTimestamp": "2017-07-18T15:39:17.816+0000", + "updatedTimestamp": "2017-07-18T15:39:17.816+0000" + }, + "protocol": "dummypod-port", + "properties": [ + { + "name": "Environment", + "value": "DEV" + }, + { + "name": "Kubernetes Namespace", + "value": "dummy-pod-ns" + }, + { + "name": "cpfrun_cluster_name", + "value": "CI-PDK1-TFINIT-CJ9125401" + } + ], + "disableType": [] + }, + { + "name": "dummy.pod.ns.dummy-pod1", + "version": { + "major": 1, + "minor": 0, + "patch": "0" + }, + "hostAddress": "192.168.120.218", + "listenPort": "32002", + "latitude": "1.0", + "longitude": "1.0", + "registrationTime": "2017-07-18T15:39:14.443+0000", + "expirationTime": "9999-10-09T15:39:14.453+0000", + "contextPath": "/", + "routeOffer": "DEFAULT", + "statusInfo": { + "status": "RUNNING" + }, + "eventStatusInfo": { + "status": "RUNNING" + }, + "validatorStatusInfo": { + "status": "RUNNING" + }, + "operationalInfo": { + "createdBy": "edge", + "updatedBy": "edge", + "createdTimestamp": "2017-07-18T15:39:14.443+0000", + "updatedTimestamp": "2017-07-18T15:39:14.443+0000" + }, + "protocol": "dummypod-port", + "properties": [ + { + "name": "Environment", + "value": "DEV" + }, + { + "name": "Kubernetes Namespace", + "value": "dummy-pod-ns" + }, + { + "name": "cpfrun_cluster_name", + "value": "CI-PDK1-TFINIT-CJ9125401" + } + ], + "disableType": [] + } + ] +}
\ No newline at end of file diff --git a/docs/api/apis/SO_Interface.rst b/docs/api/apis/SO_Interface.rst index 42571f456d..b079989aff 100644 --- a/docs/api/apis/SO_Interface.rst +++ b/docs/api/apis/SO_Interface.rst @@ -5,7 +5,7 @@ SO Interfaces ================================ -.. image:: ../images/SO_1.png +.. image:: ../../images/SO_1.png SO APIs ---------------- diff --git a/docs/api/swagger/swagger.html b/docs/api/swagger/swagger.html index dc6064bb80..3c577b7c07 100644 --- a/docs/api/swagger/swagger.html +++ b/docs/api/swagger/swagger.html @@ -924,7 +924,7 @@ margin-bottom: 20px; <div class="tab-content"> <div class="tab-pane active" id="examples-E2eServiceInstances-compareModelwithTargetVersion-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/modeldifferences"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/modeldifferences"</code></pre> </div> <div class="tab-pane" id="examples-E2eServiceInstances-compareModelwithTargetVersion-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -1251,7 +1251,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-E2eServiceInstances-createE2EServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/e2eServiceInstances/{version}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/e2eServiceInstances/{version}"</code></pre> </div> <div class="tab-pane" id="examples-E2eServiceInstances-createE2EServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -1548,7 +1548,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-E2eServiceInstances-deleteE2EServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}"</code></pre> </div> <div class="tab-pane" id="examples-E2eServiceInstances-deleteE2EServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -1875,7 +1875,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-E2eServiceInstances-getE2EServiceInstances-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}"</code></pre> </div> <div class="tab-pane" id="examples-E2eServiceInstances-getE2EServiceInstances-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -2180,7 +2180,7 @@ except ApiException as e: <div class="tab-content"> <div class="tab-pane active" id="examples-E2eServiceInstances-scaleE2EServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/scale"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/scale"</code></pre> </div> <div class="tab-pane" id="examples-E2eServiceInstances-scaleE2EServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -2507,7 +2507,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-E2eServiceInstances-updateE2EServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X PUT "https://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/onap/so/infra/e2eServiceInstances/{version}/{serviceId}"</code></pre> </div> <div class="tab-pane" id="examples-E2eServiceInstances-updateE2EServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -2837,7 +2837,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-Globalhealthcheck-globalHealthcheck-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/globalhealthcheck?enableBpmn="</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/globalhealthcheck?enableBpmn="</code></pre> </div> <div class="tab-pane" id="examples-Globalhealthcheck-globalHealthcheck-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -3083,7 +3083,7 @@ except ApiException as e: <div class="tab-content"> <div class="tab-pane active" id="examples-Nodehealthcheck-nodeHealthcheck-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/nodehealthcheck"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/nodehealthcheck"</code></pre> </div> <div class="tab-pane" id="examples-Nodehealthcheck-nodeHealthcheck-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -3294,7 +3294,7 @@ except ApiException as e: <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfracloudResources-activateOperationEnvironment-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/activate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/activate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfracloudResources-activateOperationEnvironment-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -3621,7 +3621,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfracloudResources-createOperationEnvironment-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/cloudResources/{version}/operationalEnvironments"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/cloudResources/{version}/operationalEnvironments"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfracloudResources-createOperationEnvironment-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -3918,7 +3918,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfracloudResources-deactivateOperationEnvironment-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/deactivate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/deactivate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfracloudResources-deactivateOperationEnvironment-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -4248,7 +4248,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfracloudResourcesRequests-getOperationEnvironmentStatusFilter-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/onap/so/infra/cloudResourcesRequests/{version}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/cloudResourcesRequests/{version}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfracloudResourcesRequests-getOperationEnvironmentStatusFilter-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -4493,7 +4493,7 @@ except ApiException as e: <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfracloudResourcesRequests-unlockOrchestrationRequestForReqId-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/cloudResourcesRequests/{version}/{requestId}/unlock"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/cloudResourcesRequests/{version}/{requestId}/unlock"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfracloudResourcesRequests-unlockOrchestrationRequestForReqId-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -4823,7 +4823,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinframodelDistributions-updateModelDistributionStatus-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/modelDistributions/{version}/distributions/{distributionId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/modelDistributions/{version}/distributions/{distributionId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinframodelDistributions-updateModelDistributionStatus-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -5153,7 +5153,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraorchestrationRequests-getOrchestrationRequest-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/onap/so/infra/orchestrationRequests/{version}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/orchestrationRequests/{version}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraorchestrationRequests-getOrchestrationRequest-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -5398,7 +5398,7 @@ except ApiException as e: <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraorchestrationRequests-getOrchestrationRequestForReqId-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/onap/so/infra/orchestrationRequests/{version}/{requestId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/orchestrationRequests/{version}/{requestId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraorchestrationRequests-getOrchestrationRequestForReqId-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -5673,7 +5673,7 @@ except ApiException as e: <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraorchestrationRequests-unlockOrchestrationRequest-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/orchestrationRequests/{version}/{requestId}/unlock"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/orchestrationRequests/{version}/{requestId}/unlock"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraorchestrationRequests-unlockOrchestrationRequest-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -6003,7 +6003,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-activatePort-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-activatePort-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -6360,7 +6360,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-activateServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/activate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/activate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-activateServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -6687,7 +6687,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-addRelationships-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/addRelationships"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/addRelationships"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-addRelationships-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -7014,7 +7014,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-applyUpdatedConfig-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-applyUpdatedConfig-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -7371,7 +7371,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-assignServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/assign"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/assign"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-assignServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -7668,7 +7668,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-createNetworkInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-createNetworkInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -7995,7 +7995,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-createPortConfiguration-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-createPortConfiguration-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -8322,7 +8322,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-createServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-createServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -8619,7 +8619,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-createVfModuleInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-createVfModuleInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -8976,7 +8976,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-createVnfInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-createVnfInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -9303,7 +9303,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-createVolumeGroupInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-createVolumeGroupInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -9660,7 +9660,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deactivateAndCloudDeleteVfModuleInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deactivateAndCloudDeleteVfModuleInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -10047,7 +10047,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deactivatePort-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deactivatePort-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -10404,7 +10404,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deactivateServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/deactivate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/deactivate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deactivateServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -10731,7 +10731,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deleteNetworkInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deleteNetworkInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -11088,7 +11088,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deletePortConfiguration-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deletePortConfiguration-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -11445,7 +11445,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deleteServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deleteServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -11772,7 +11772,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deleteVfModuleInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deleteVfModuleInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -12159,7 +12159,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deleteVnfInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deleteVnfInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -12516,7 +12516,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-deleteVolumeGroupInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X DELETE "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-deleteVolumeGroupInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -12903,7 +12903,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-disablePort-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-disablePort-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -13260,7 +13260,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-enablePort-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-enablePort-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -13617,7 +13617,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-inPlaceSoftwareUpdate-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-inPlaceSoftwareUpdate-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -13974,7 +13974,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-removeRelationships-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/removeRelationships"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/removeRelationships"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-removeRelationships-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -14301,7 +14301,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-replaceVfModuleInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-replaceVfModuleInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -14688,7 +14688,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-replaceVnfInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-replaceVnfInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -15045,7 +15045,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-scaleOutVfModule-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-scaleOutVfModule-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -15402,7 +15402,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-unassignServiceInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X POST "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/unassign"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X POST "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/unassign"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-unassignServiceInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -15729,7 +15729,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-updateNetworkInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X PUT "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-updateNetworkInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -16086,7 +16086,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-updateVfModuleInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X PUT "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-updateVfModuleInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -16473,7 +16473,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-updateVnfInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X PUT "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-updateVnfInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -16830,7 +16830,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-OnapsoinfraserviceInstantiation-updateVolumeGroupInstance-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X PUT "https://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}"</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X PUT "http://localhost/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}"</code></pre> </div> <div class="tab-pane" id="examples-OnapsoinfraserviceInstantiation-updateVolumeGroupInstance-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -17220,7 +17220,7 @@ $(document).ready(function() { <div class="tab-content"> <div class="tab-pane active" id="examples-Onapsoinfratasks-queryFilters-0-curl"> - <pre class="prettyprint"><code class="language-bsh">curl -X GET "https://localhost/onap/so/infra/tasks/{version}?taskId=&originalRequestId=&subscriptionServiceType=&nfRole=&buildingBlockName=&originalRequestDate=&originalRequestorId="</code></pre> + <pre class="prettyprint"><code class="language-bsh">curl -X GET "http://localhost/onap/so/infra/tasks/{version}?taskId=&originalRequestId=&subscriptionServiceType=&nfRole=&buildingBlockName=&originalRequestDate=&originalRequestorId="</code></pre> </div> <div class="tab-pane" id="examples-Onapsoinfratasks-queryFilters-0-java"> <pre class="prettyprint"><code class="language-java">import io.swagger.client.*; @@ -17638,7 +17638,7 @@ except ApiException as e: </div> <div id="generator"> <div class="content"> - Generated 2018-09-26T06:32:35.799Z + Generated 2018-11-19T03:11:19.743Z </div> </div> </div> diff --git a/docs/api/swagger/swagger.json b/docs/api/swagger/swagger.json index 65d7ff0d11..6ba8380a5f 100644 --- a/docs/api/swagger/swagger.json +++ b/docs/api/swagger/swagger.json @@ -34,10 +34,10 @@ } ], "schemes": [ - "https" + "http" ], "paths": { - "/e2eServiceInstances/{version}": { + "/onap/so/infra/e2eServiceInstances/{version}": { "post": { "tags": [ "e2eServiceInstances" @@ -75,7 +75,7 @@ } } }, - "/e2eServiceInstances/{version}/{serviceId}": { + "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}": { "put": { "tags": [ "e2eServiceInstances" @@ -161,7 +161,7 @@ } } }, - "/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}": { + "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}": { "get": { "tags": [ "e2eServiceInstances" @@ -200,7 +200,7 @@ } } }, - "/e2eServiceInstances/{version}/{serviceId}/scale": { + "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/scale": { "post": { "tags": [ "e2eServiceInstances" @@ -244,7 +244,7 @@ } } }, - "/e2eServiceInstances/{version}/{serviceId}/modeldifferences": { + "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/modeldifferences": { "post": { "tags": [ "e2eServiceInstances" diff --git a/docs/api/swagger/swagger.yaml b/docs/api/swagger/swagger.yaml index 86f8e4c64e..11c72b612c 100644 --- a/docs/api/swagger/swagger.yaml +++ b/docs/api/swagger/swagger.yaml @@ -13,7 +13,7 @@ tags: - name: onapsoinfracloudResourcesRequests - name: onapsoinframodelDistributions schemes: - - https + - http paths: '/onap/so/infra/e2eServiceInstances/{version}': post: diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java index 440a9ea3ee..7f602323e1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/MsoRequest.java @@ -162,7 +162,7 @@ public class MsoRequest { public void parse (ServiceInstancesRequest sir, HashMap<String,String> instanceIdMap, Actions action, String version, String originalRequestJSON, int reqVersion, Boolean aLaCarteFlag) throws ValidationException, IOException { - msoLogger.debug ("Validating the Service Instance request"); + msoLogger.debug ("Validating the Service Instance request"); List<ValidationRule> rules = new ArrayList<>(); msoLogger.debug ("Incoming version is: " + version + " coverting to int: " + reqVersion); RequestParameters requestParameters = sir.getRequestDetails().getRequestParameters(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java index 7ee8654013..b65b82a87d 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/OrchestrationRequests.java @@ -333,6 +333,10 @@ public class OrchestrationRequests { String startTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getStartTime()) + " GMT"; request.setStartTime(startTimeStamp); } + if(iar.getEndTime() != null){ + String endTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getEndTime()) + " GMT"; + request.setFinishTime(endTimeStamp); + } String statusMessages = null; RequestStatus status = new RequestStatus(); if(iar.getStatusMessage() != null){ @@ -362,10 +366,6 @@ public class OrchestrationRequests { if(statusMessages != null){ status.setStatusMessage(statusMessages); } - if(iar.getEndTime() != null){ - String endTimeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getEndTime()) + " GMT"; - status.setFinishTime(endTimeStamp); - } if(iar.getModifyTime() != null){ String timeStamp = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss").format(iar.getModifyTime()) + " GMT"; status.setTimeStamp(timeStamp); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/UserParamsValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/UserParamsValidation.java index da1f1f6e90..894e488e92 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/UserParamsValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/UserParamsValidation.java @@ -27,56 +27,60 @@ import java.util.List; import org.onap.so.apihandlerinfra.Action; import org.onap.so.apihandlerinfra.Actions; import org.onap.so.exceptions.ValidationException; +import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.Networks; import org.onap.so.serviceinstancebeans.Service; import org.onap.so.serviceinstancebeans.VfModules; import org.onap.so.serviceinstancebeans.Vnfs; public class UserParamsValidation implements ValidationRule{ - private static boolean empty(String s) { - return (s == null || s.trim().isEmpty()); - } @Override public ValidationInformation validate(ValidationInformation info) throws ValidationException{ Service validate = info.getUserParams(); Actions action = info.getAction(); if(validate.getModelInfo() == null){ - throw new ValidationException ("model-info in userParams"); + throw new ValidationException ("modelInfo in userParams", true); + }else if(validate.getModelInfo().getModelType() == null){ + throw new ValidationException("modelType in userParams service modelInfo", true); }else if(validate.getModelInfo().getModelVersionId() == null){ - throw new ValidationException("modelVersionId in userParams"); + throw new ValidationException("modelVersionId in userParams service modelInfo", true); + } + modelInfoValidation(info.getSir().getRequestDetails().getModelInfo(), validate.getModelInfo()); + if(validate.getInstanceName() != null && info.getRequestInfo().getInstanceName() != null){ + instanceNameValidation(info, validate); } for(Vnfs vnf : validate.getResources().getVnfs()){ if(vnf.getModelInfo() == null){ - throw new ValidationException ("model-info in userParams vnf resources"); + throw new ValidationException ("modelInfo in userParams vnf resources", true); }else if(vnf.getModelInfo().getModelCustomizationId() == null){ - throw new ValidationException ("modelCustomizationId in userParams vnf resources"); + throw new ValidationException ("modelCustomizationId in userParams vnf resources", true); }else if(vnf.getModelInfo().getModelVersionId() == null){ - throw new ValidationException("modelVersionId in userParams vnf resources"); + throw new ValidationException("modelVersionId in userParams vnf resources", true); } if(vnf.getCloudConfiguration() == null){ - throw new ValidationException ("cloudConfiguration in userParams vnf resources"); + throw new ValidationException ("cloudConfiguration in userParams vnf resources", true); } if(action == Action.createInstance || action == Action.assignInstance){ if(vnf.getPlatform() == null){ - throw new ValidationException ("platform in userParams vnf resources"); + throw new ValidationException ("platform in userParams vnf resources", true); }if(vnf.getProductFamilyId() == null){ - throw new ValidationException ("productFamilyId in userParams vnf resources"); + throw new ValidationException ("productFamilyId in userParams vnf resources", true); } } if (vnf.getPlatform() != null && vnf.getPlatform().getPlatformName() == null){ - throw new ValidationException ("platformName in userParams vnf resources"); + throw new ValidationException ("platformName in userParams vnf resources", true); } if(vnf.getVfModules().isEmpty()){ - throw new ValidationException ("vfModules in userParams vnf resources"); + throw new ValidationException ("vfModules in userParams vnf resources", true); } for(VfModules vfModules : vnf.getVfModules()){ if(vfModules.getModelInfo() == null){ - throw new ValidationException ("model-info in userParams vfModules resources"); + throw new ValidationException ("modelInfo in userParams vfModules resources", true); }else if(vfModules.getModelInfo().getModelCustomizationId() == null){ - throw new ValidationException ("modelCustomizationId in userParams vfModule resources"); + throw new ValidationException ("modelCustomizationId in userParams vfModule resources", true); }else if(vfModules.getModelInfo().getModelVersionId() == null){ - throw new ValidationException("modelVersionId in userParams vfModule resources"); + throw new ValidationException("modelVersionId in userParams vfModule resources", true); } } } @@ -86,17 +90,46 @@ public class UserParamsValidation implements ValidationRule{ if(validateNetworks != null){ for(Networks networks : validateNetworks){ if(networks.getModelInfo() == null){ - throw new ValidationException ("model-info in userParams network resources"); + throw new ValidationException ("modelInfo in userParams network resources", true); }else if(networks.getModelInfo().getModelCustomizationId() == null){ - throw new ValidationException ("modelCustomizationId in userParams network resources"); + throw new ValidationException ("modelCustomizationId in userParams network resources", true); }else if(networks.getModelInfo().getModelVersionId() == null){ - throw new ValidationException("modelVersionId in userParams network resources"); + throw new ValidationException("modelVersionId in userParams network resources", true); } if(networks.getCloudConfiguration() == null){ - throw new ValidationException ("cloudConfiguration in userParams network resources"); + throw new ValidationException ("cloudConfiguration in userParams network resources", true); } } } return info; } + public void instanceNameValidation(ValidationInformation info, Service validate) throws ValidationException{ + if(!info.getRequestInfo().getInstanceName().equals(validate.getInstanceName())){ + throw new ValidationException("instanceName in requestInfo", "instanceName in userParams service"); + } + } + public void modelInfoValidation(ModelInfo info, ModelInfo userParamInfo) throws ValidationException{ + if(!info.getModelType().equals(userParamInfo.getModelType())){ + throw new ValidationException("modelType in modelInfo", "modelType in userParams service"); + } + if((info.getModelInvariantId() != null && userParamInfo.getModelInvariantId() != null) && + (!info.getModelInvariantId().equals(userParamInfo.getModelInvariantId()))){ + throw new ValidationException("modelInvariantId in modelInfo", "modelInvariantId in userParams service"); + } + if(!info.getModelVersionId().equals(userParamInfo.getModelVersionId())){ + throw new ValidationException("modelVersionId in modelInfo", "modelVersionId in userParams service"); + } + if((info.getModelName() != null && userParamInfo.getModelName() != null) && + (!info.getModelName().equals(userParamInfo.getModelName()))){ + throw new ValidationException("modelName in modelInfo", "modelName in userParams service"); + } + if((info.getModelVersion() != null && userParamInfo.getModelVersion() != null) && + (!info.getModelVersion().equals(userParamInfo.getModelVersion()))){ + throw new ValidationException("modelVersion in modelInfo", "modelVersion in userParams service"); + } + if((info.getModelCustomizationId() != null && userParamInfo.getModelCustomizationId() != null) && + (!info.getModelCustomizationId().equals(userParamInfo.getModelCustomizationId()))){ + throw new ValidationException("modelCustomizationId in modelInfo", "modelCustomizationId in userParams service"); + } + } }
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java index aa51704724..145213fc6c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/MsoRequestTest.java @@ -317,9 +317,9 @@ public class MsoRequestTest extends BaseTest { //Validation for UserParams {"No valid cloudConfiguration in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/AssignCloudConfigVnf.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid cloudConfiguration in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/NetworkCloudConfig.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, - {"No valid model-info in userParams is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsModelInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, - {"No valid model-info in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsVnfModelInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, - {"No valid modelVersionId in userParams is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, + {"No valid modelInfo in userParams is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsModelInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, + {"No valid modelInfo in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsVnfModelInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, + {"No valid modelVersionId in userParams service modelInfo is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid modelVersionId in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/VnfModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid modelVersionId in userParams vfModule resources is specified", mapper.readValue(inputStream("/RequestParameters/VfModuleModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid modelVersionId in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/NetworkModelVersionId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, @@ -327,8 +327,8 @@ public class MsoRequestTest extends BaseTest { {"No valid platformName in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/UserParamsPlatformName.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid productFamilyId in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/ProductFamilyId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid vfModules in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/VfModules.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, - {"No valid model-info in userParams vfModules resources is specified", mapper.readValue(inputStream("/RequestParameters/VfModulesModelInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, - {"No valid model-info in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/Network.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, + {"No valid modelInfo in userParams vfModules resources is specified", mapper.readValue(inputStream("/RequestParameters/VfModulesModelInfo.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, + {"No valid modelInfo in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/Network.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid modelCustomizationId in userParams vfModule resources is specified", mapper.readValue(inputStream("/RequestParameters/VfModuleModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid modelCustomizationId in userParams vnf resources is specified", mapper.readValue(inputStream("/RequestParameters/VnfModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, {"No valid modelCustomizationId in userParams network resources is specified", mapper.readValue(inputStream("/RequestParameters/NetworkModelCustomizationId.json"), ServiceInstancesRequest.class), instanceIdMapTest, Action.assignInstance, 7}, diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java index 4a6a59bebb..28797d247b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/OrchestrationRequestsTest.java @@ -31,6 +31,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static com.shazam.shazamcrest.MatcherAssert.assertThat; import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.io.File; import java.io.IOException; @@ -118,13 +119,14 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.finishTime") .ignoring("request.requestStatus.timeStamp")); assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0)); assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0)); assertEquals("0", response.getHeaders().get("X-PatchVersion").get(0)); assertEquals("7.0.0", response.getHeaders().get("X-LatestVersion").get(0)); assertEquals("00032ab7-na18-42e5-965d-8ea592502018", response.getHeaders().get("X-TransactionID").get(0)); + assertNotNull(response.getBody().getRequest().getFinishTime()); } @Test @@ -149,8 +151,7 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime") - .ignoring("request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.finishTime") .ignoring("request.requestStatus.timeStamp")); } @@ -177,8 +178,7 @@ public class OrchestrationRequestsTest extends BaseTest { assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("request.startTime") - .ignoring("request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("request.startTime").ignoring("request.finishTime") .ignoring("request.requestStatus.timeStamp")); assertEquals("application/json", response.getHeaders().get(HttpHeaders.CONTENT_TYPE).get(0)); assertEquals("0", response.getHeaders().get("X-MinorVersion").get(0)); @@ -227,8 +227,7 @@ public class OrchestrationRequestsTest extends BaseTest { ResponseEntity<GetOrchestrationListResponse> response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, entity, GetOrchestrationListResponse.class); assertThat(response.getBody(), - sameBeanAs(testResponse).ignoring("requestList.request.startTime") - .ignoring("requestList.request.requestStatus.finishTime") + sameBeanAs(testResponse).ignoring("requestList.request.startTime").ignoring("requestList.request.finishTime") .ignoring("requestList.request.requestStatus.timeStamp")); assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); assertEquals(requests.size(), response.getBody().getRequestList().size()); @@ -482,4 +481,4 @@ public class OrchestrationRequestsTest extends BaseTest { .withBody(new String(Files.readAllBytes(Paths.get("src/test/resources/OrchestrationRequest/getRequestDetailsFilter.json")))) .withStatus(HttpStatus.SC_OK))); } -}
\ No newline at end of file +} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java index 809e39c772..100bc82f7a 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/tenantisolation/process/CreateVnfOperationalEnvironmentTest.java @@ -52,6 +52,7 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ private CloudOrchestrationRequest request; private ServiceEndPointList serviceEndpoints; + private ServiceEndPointList serviceEndpoints2; @Autowired private CreateVnfOperationalEnvironment createVnfOpEnv; @@ -63,6 +64,8 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ request = mapper.readValue(jsonRequest, CloudOrchestrationRequest.class); String jsonServiceEndpoints = getFileContentsAsString("__files/vnfoperenv/endpoints.json"); serviceEndpoints = mapper.readValue(jsonServiceEndpoints, ServiceEndPointList.class); + String jsonServiceEndpoints2 = getFileContentsAsString("__files/vnfoperenv/endpoints2.json"); + serviceEndpoints2 = mapper.readValue(jsonServiceEndpoints2, ServiceEndPointList.class); } @Test public void testGetEcompManagingEnvironmentId() throws Exception { @@ -83,6 +86,13 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ assertEquals("DEV", createVnfOpEnv.getEnvironmentName(props)); } + @Test + public void testGetEnvironmentNameEndpointListBeginWithUpperCase() { + createVnfOpEnv.setRequest(request); + List<Property> props = serviceEndpoints2.getServiceEndPointList().get(0).getProperties(); + assertEquals("DEV", createVnfOpEnv.getEnvironmentName(props)); + } + @Test public void testBuildServiceNameForVnf() throws Exception { createVnfOpEnv.setRequest(request); @@ -141,4 +151,34 @@ public class CreateVnfOperationalEnvironmentTest extends BaseTest{ .withStatus(HttpStatus.SC_OK))); createVnfOpEnv.execute(requestId, request); } + + @Test + public void testExecuteEndpointsListBeginWithUppercase() throws ApiException, JsonProcessingException { + stubFor(get(urlPathMatching("/aai/" + AAIVersion.LATEST + "/cloud-infrastructure/operational-environments/.*")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/ecompOperationalEnvironment.json").withStatus(HttpStatus.SC_ACCEPTED))); + stubFor(post(urlPathMatching("/GRMLWPService/v1/serviceEndPoint/findRunning")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/endpoints2.json").withStatus(HttpStatus.SC_ACCEPTED))); + stubFor(post(urlPathMatching("/GRMLWPService/v1/serviceEndPoint/add")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withStatus(HttpStatus.SC_ACCEPTED))); + stubFor(put(urlPathMatching("/aai/" + AAIVersion.LATEST + "/cloud-infrastructure/operational-environments/.*")) + .willReturn(aResponse().withHeader("Content-Type", "application/json").withBodyFile("vnfoperenv/ecompOperationalEnvironment.json").withStatus(HttpStatus.SC_ACCEPTED))); + String requestId = UUID.randomUUID().toString(); + InfraActiveRequests iar = new InfraActiveRequests(); + iar.setRequestId(requestId); + iar.setOperationalEnvName("myOpEnv"); + iar.setRequestScope("create"); + iar.setRequestStatus("PENDING"); + iar.setRequestAction("UNKNOWN"); + ObjectMapper mapper = new ObjectMapper(); + stubFor(post(urlPathEqualTo("/infraActiveRequests/")) + .withRequestBody(containing("{\"requestId\":\""+ requestId+"\",\"clientRequestId\":null,\"action\":null,\"requestStatus\":\"COMPLETE\",\"statusMessage\":\"SUCCESSFUL")) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withStatus(HttpStatus.SC_OK))); + + stubFor(get(urlPathEqualTo("/infraActiveRequests/"+requestId)) + .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) + .withBody(mapper.writeValueAsString(iar)) + .withStatus(HttpStatus.SC_OK))); + createVnfOpEnv.execute(requestId, request); + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/UserParamsValidationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/UserParamsValidationTest.java new file mode 100644 index 0000000000..c1c4915672 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/UserParamsValidationTest.java @@ -0,0 +1,109 @@ +/*- + * ============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.apihandlerinfra.validation; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Map; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.onap.so.apihandlerinfra.Action; +import org.onap.so.exceptions.ValidationException; +import org.onap.so.serviceinstancebeans.Service; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; + +import com.fasterxml.jackson.databind.ObjectMapper; + +public class UserParamsValidationTest{ + + UserParamsValidation validation = new UserParamsValidation(); + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + public ValidationInformation setupValidationInformation(String path) throws IOException{ + String jsonInput = new String(Files.readAllBytes(Paths.get(path))); + ObjectMapper mapper = new ObjectMapper(); + ServiceInstancesRequest sir = mapper.readValue(jsonInput, ServiceInstancesRequest.class); + ValidationInformation info = new ValidationInformation(sir, null, Action.createInstance, 7, false, sir.getRequestDetails().getRequestParameters()); + for(Map<String, Object> params : sir.getRequestDetails().getRequestParameters().getUserParams()){ + ObjectMapper obj = new ObjectMapper(); + String input = obj.writeValueAsString(params.get("service")); + Service validate = obj.readValue(input, Service.class); + info.setUserParams(validate); + break; + } + info.setRequestInfo(sir.getRequestDetails().getRequestInfo()); + return info; + } + + @Test + public void validateModelTypeExceptionTest() throws IOException, ValidationException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("No valid modelType in userParams service modelInfo is specified"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelInfoNoModelType.json")); + } + @Test + public void validateInstanceNameExceptionTest() throws IOException, ValidationException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("instanceName in requestInfo does not match instanceName in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/MacroRequest.json")); + } + @Test + public void validateModelTypeTest() throws ValidationException, IOException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("modelType in modelInfo does not match modelType in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelType.json")); + } + @Test + public void validateModelInvariantIdTest() throws ValidationException, IOException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("modelInvariantId in modelInfo does not match modelInvariantId in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelInvariantId.json")); + } + @Test + public void validateModelVersionIdTest() throws ValidationException, IOException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("modelVersionId in modelInfo does not match modelVersionId in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelVersionId.json")); + } + @Test + public void validateModelNameTest() throws ValidationException, IOException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("modelName in modelInfo does not match modelName in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelName.json")); + } + @Test + public void validateModelVersionTest() throws ValidationException, IOException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("modelVersion in modelInfo does not match modelVersion in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelVersion.json")); + } + @Test + public void validateModelCustomizationIdTest() throws ValidationException, IOException{ + thrown.expect(ValidationException.class); + thrown.expectMessage("modelCustomizationId in modelInfo does not match modelCustomizationId in userParams service"); + validation.validate(setupValidationInformation("src/test/resources/Validation/UserParamsValidation/ModelCustomizationId.json")); + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/AssignCloudConfigVnf.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/AssignCloudConfigVnf.json index 9e571e6e37..9d575695c5 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/AssignCloudConfigVnf.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/AssignCloudConfigVnf.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "testModelName", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "testModelName", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/Network.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/Network.json index 26bb2172f8..a7d930f756 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/Network.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/Network.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkCloudConfig.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkCloudConfig.json index 6b32f3ebe3..75e8fb5cd1 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkCloudConfig.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkCloudConfig.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelCustomizationId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelCustomizationId.json index 1aa6094513..baf620b668 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelCustomizationId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelCustomizationId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelVersionId.json index 1fddf7970b..6c152855ee 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelVersionId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/NetworkModelVersionId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/ProductFamilyId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/ProductFamilyId.json index f9a5ea9a01..3f93139587 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/ProductFamilyId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/ProductFamilyId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsModelVersionId.json index 8d3ed69863..f3592c2e05 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsModelVersionId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsModelVersionId.json @@ -34,8 +34,10 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatform.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatform.json index f05fdb06ba..0fbe1dadcc 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatform.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatform.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatformName.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatformName.json index 4436baffe4..e94c5aad13 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatformName.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsPlatformName.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsVnfModelInfo.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsVnfModelInfo.json index e31523f99d..c19784f2fe 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsVnfModelInfo.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/UserParamsVnfModelInfo.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelCustomizationId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelCustomizationId.json index 0cf4928581..f315ff89a6 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelCustomizationId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelCustomizationId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelVersionId.json index 5362b439dc..91e71839a2 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelVersionId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModuleModelVersionId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModules.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModules.json index ad1c02e37b..fedaad42df 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModules.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModules.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModulesModelInfo.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModulesModelInfo.json index 81904fe66a..612586c84f 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModulesModelInfo.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VfModulesModelInfo.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelCustomizationId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelCustomizationId.json index 5b4097793c..8709619fb9 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelCustomizationId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelCustomizationId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelVersionId.json index b52be1f4c2..9c650ad439 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelVersionId.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/RequestParameters/VnfModelVersionId.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json index 2d7ab4ae7c..bc6f8fc610 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/MsoRequestTest/SuccessfulValidation/ServiceAssign.json @@ -34,9 +34,11 @@ { "service": { "modelInfo": { - "modelName": "MOW vMX BV 1 Service", - "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0b" + "modelType": "service", + "modelInvariantId": "5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId": "3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName": "MOW vMX BV 1 Service", + "modelVersion": "10" }, "instanceParams": [], "resources": { diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json index 50654524f1..dde4392c38 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/OrchestrationRequest/OrchestrationFilterResponse.json @@ -29,7 +29,6 @@ "requestState": "COMPLETE", "statusMessage": "STATUS: COMPLETED", "percentProgress": 100, - "finishTime": "Tue, 02 May 2017 06:33:34 GMT", "timeStamp": "Fri, 01 Jul 2016 04:41:42 GMT" } } @@ -64,7 +63,6 @@ "requestState": "COMPLETE", "statusMessage": "STATUS: Vf Module has been deleted successfully. FLOW STATUS: Building blocks 1 of 3 completed. ROLLBACK STATUS: Rollback has been completed successfully.", "percentProgress": 100, - "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT", "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } @@ -99,7 +97,6 @@ "requestState": "PENDING", "statusMessage": "STATUS: Vf Module deletion pending.", "percentProgress": 0, - "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT", "timeStamp": "Thu, 22 Dec 2016 08:30:28 GMT" } } @@ -184,7 +181,6 @@ "requestState": "UNLOCKED", "statusMessage": "STATUS: Vf Module deletion pending.", "percentProgress": 0, - "finishTime": "Thu, 22 Dec 2016 08:30:28 GMT", "timeStamp": "Mon, 30 Jul 2018 06:09:01 GMT" } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceAssign.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceAssign.json index 7625bf7589..fd8b7c4e69 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceAssign.json +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/ServiceInstanceTest/ServiceAssign.json @@ -35,9 +35,10 @@ "service":{ "modelInfo":{ "modelType":"service", - "modelName":"MOW", - "modelVersionId":"3c40d244-808e-42ca-b09a-256d83d19d0a", - "modelCustomizationId": "3c40d244-808e-42ca-b09a-256d83d19d0a" + "modelInvariantId":"5d48acb5-097d-4982-aeb2-f4a3bd87d31b", + "modelVersionId":"3c40d244-808e-42ca-b09a-256d83d19d0a", + "modelName":"MOW vMX BV 1 Service", + "modelVersion":"10.0" }, "instanceParams":[ diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/MacroRequest.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/MacroRequest.json new file mode 100644 index 0000000000..c3ee53b3b4 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/MacroRequest.json @@ -0,0 +1,135 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelCustomizationId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelCustomizationId.json new file mode 100644 index 0000000000..f5209ac774 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelCustomizationId.json @@ -0,0 +1,137 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbad" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbae" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelInfoNoModelType.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelInfoNoModelType.json new file mode 100644 index 0000000000..ffcb48daf3 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelInfoNoModelType.json @@ -0,0 +1,134 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelInvariantId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelInvariantId.json new file mode 100644 index 0000000000..13796ed3f9 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelInvariantId.json @@ -0,0 +1,135 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531e", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelName.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelName.json new file mode 100644 index 0000000000..0410b9c50d --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelName.json @@ -0,0 +1,135 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST2", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelType.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelType.json new file mode 100644 index 0000000000..f287864a93 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelType.json @@ -0,0 +1,135 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "vnf", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelVersion.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelVersion.json new file mode 100644 index 0000000000..ed2dffeb41 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelVersion.json @@ -0,0 +1,135 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "2.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelVersionId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelVersionId.json new file mode 100644 index 0000000000..feb08a3b6d --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/ModelVersionId.json @@ -0,0 +1,135 @@ +{ + "requestDetails": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daee", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "requestInfo": { + "productFamilyId": "testaaS", + "source": "VID", + "suppressRollback": false, + "requestorId": "ss616y", + "instanceName": "instanceName" + }, + "subscriberInfo": { + "globalSubscriberId": "21014aa2-526b-11e6-beb8-9e71128cae77" + }, + "requestParameters": { + "subscriptionServiceType": "test", + "userParams": [ + { + "service": { + "modelInfo": { + "modelInvariantId": "282bdcd2-34ed-4665-9ab2-63455814531d", + "modelType": "service", + "modelName": "MOW_ADIG_test_BV_IST", + "modelVersion": "1.0", + "modelVersionId": "109a153e-325f-4df5-8161-edd91314daed", + "modelUuid": "109a153e-325f-4df5-8161-edd91314daee", + "modelInvariantUuid": "282bdcd2-34ed-4665-9ab2-63455814531d" + }, + "instanceName" : "test", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_bandwidth": "10", + "mow_adig_test_bv_ist0_ASN": "2685", + "mow_adig_test_bv_ist0_availability_zone_0": "mdt25b-kvm-az01", + "mow_adig_test_bv_ist0_AIC_CLLI": "MTSNJA4LCP1", + "mow_adig_test_bv_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_bv_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth_units": "Gbps" + } + ], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelCustomizationName": "MOW_ADIG_test_BV_IST 0", + "modelCustomizationId": "31d41ef2-0a3e-43bf-a4f0-0b1f31b1cbac", + "modelInvariantId": "33fb95d0-5f18-4dfb-8e7d-0c8ac8d743c5", + "modelVersionId": "bdf50902-4b07-4dcf-a2e2-ec6cfe568798", + "modelName": "MOW_ADIG_test_BV_IST", + "modelType": "service", + "modelVersion": "2.0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "mdt25b", + "tenantId": "aefb697db6524ddebfe4915591b0a347" + }, + "platform": { + "platformName": "AIC" + }, + "lineOfBusiness": {}, + "productFamilyId": "testaaS", + "instanceParams": [ + { + "mow_adig_test_bv_ist0_vnf_config_template": "17.2", + "mow_adig_test_bv_ist0_vnf_instance": "wswdc403me6", + "mow_adig_test_bv_ist0_bandwidth": "Gbps" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelCustomizationId": "34c57c2d-cf19-4926-9296-acde6a967f70", + "modelInvariantId": "f3093158-a609-41d5-a2fb-07dbc0ca8096", + "modelVersionId": "2507f79d-6e1b-413b-b2a8-c434113ff862", + "modelName": "MowAdigtestBvIst..ADIG_vRE_BV_v2..module-1", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [ + { + "mow_adig_test_ist0_vnf_config_template_version": "17.2", + "mow_adig_test_ist0_vnf_instance_name": "wswdc403me6", + "mow_adig_test_ist0_bandwidth_units": "Gbps" + } + ] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelCustomizationId": "f4a414c4-b71a-43ed-82be-51478d7e154f", + "modelInvariantId": "af867fdc-3808-4b62-ae76-bdb1b9ae7ee8", + "modelVersionId": "3fcf6cb6-2ef2-4154-99a6-06ce889c79f1", + "modelName": "MowAdigtestBvIst..ADIG_base_test_BV_v2..module-0", + "modelType": "service", + "modelVersion": "1" + }, + "instanceParams": [] + }, + { + "modelInfo": { + "modelCustomizationName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelCustomizationId": "583c2280-23d9-4338-a607-69c238d4899d", + "modelInvariantId": "90c2be4f-cb6f-4e75-9c65-04fdc5c30cef", + "modelVersionId": "7c8a69e0-6612-4b7b-8e9c-fb8b9f31cb4f", + "modelName": "MowAdigtestBvIst..ADIG_vPFE_BV_v2..module-2", + "modelType": "service", + "modelVersion": "1" + } + } + ] + } + ] + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "GigaPower" + }, + "owningEntity": { + "owningEntityId": "2811e2fb-005e-40de-990b-c0794f362399", + "owningEntityName": "PACKET-CORE" + } + } +}
\ No newline at end of file diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/vnfoperenv/endpoints2.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/vnfoperenv/endpoints2.json new file mode 100644 index 0000000000..7c9816ff55 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/__files/vnfoperenv/endpoints2.json @@ -0,0 +1,145 @@ +{ + "ServiceEndPointList": [ + { + "name": "dummy.pod.ns.dummy-pod3", + "version": { + "major": 1, + "minor": 0, + "patch": "0" + }, + "hostAddress": "192.168.120.218", + "listenPort": "32004", + "latitude": "37.7022", + "longitude": "121.9358", + "registrationTime": "2017-07-18T15:39:17.367+0000", + "expirationTime": "9999-10-09T15:39:17.368+0000", + "contextPath": "/", + "routeOffer": "DEFAULT", + "statusInfo": { + "status": "RUNNING" + }, + "eventStatusInfo": { + "status": "RUNNING" + }, + "validatorStatusInfo": { + "status": "RUNNING" + }, + "operationalInfo": { + "createdBy": "edge", + "updatedBy": "edge", + "createdTimestamp": "2017-07-18T15:39:17.367+0000", + "updatedTimestamp": "2017-07-18T15:39:17.367+0000" + }, + "protocol": "dummypod-port", + "properties": [ + { + "name": "Environment", + "value": "DEV" + }, + { + "name": "Kubernetes Namespace", + "value": "dummy-pod-ns" + }, + { + "name": "cpfrun_cluster_name", + "value": "CI-PDK1-TFINIT-CJ9125401" + } + ], + "disableType": [] + }, + { + "name": "dummy.pod.ns.dummy-pod3", + "version": { + "major": 1, + "minor": 0, + "patch": "0" + }, + "hostAddress": "192.168.120.22", + "listenPort": "32004", + "latitude": "1.0", + "longitude": "1.0", + "registrationTime": "2017-07-18T15:39:17.816+0000", + "expirationTime": "9999-10-09T15:39:17.817+0000", + "contextPath": "/", + "routeOffer": "DEFAULT", + "statusInfo": { + "status": "RUNNING" + }, + "eventStatusInfo": { + "status": "RUNNING" + }, + "validatorStatusInfo": { + "status": "RUNNING" + }, + "operationalInfo": { + "createdBy": "edge", + "updatedBy": "edge", + "createdTimestamp": "2017-07-18T15:39:17.816+0000", + "updatedTimestamp": "2017-07-18T15:39:17.816+0000" + }, + "protocol": "dummypod-port", + "properties": [ + { + "name": "Environment", + "value": "DEV" + }, + { + "name": "Kubernetes Namespace", + "value": "dummy-pod-ns" + }, + { + "name": "cpfrun_cluster_name", + "value": "CI-PDK1-TFINIT-CJ9125401" + } + ], + "disableType": [] + }, + { + "name": "dummy.pod.ns.dummy-pod1", + "version": { + "major": 1, + "minor": 0, + "patch": "0" + }, + "hostAddress": "192.168.120.218", + "listenPort": "32002", + "latitude": "1.0", + "longitude": "1.0", + "registrationTime": "2017-07-18T15:39:14.443+0000", + "expirationTime": "9999-10-09T15:39:14.453+0000", + "contextPath": "/", + "routeOffer": "DEFAULT", + "statusInfo": { + "status": "RUNNING" + }, + "eventStatusInfo": { + "status": "RUNNING" + }, + "validatorStatusInfo": { + "status": "RUNNING" + }, + "operationalInfo": { + "createdBy": "edge", + "updatedBy": "edge", + "createdTimestamp": "2017-07-18T15:39:14.443+0000", + "updatedTimestamp": "2017-07-18T15:39:14.443+0000" + }, + "protocol": "dummypod-port", + "properties": [ + { + "name": "Environment", + "value": "DEV" + }, + { + "name": "Kubernetes Namespace", + "value": "dummy-pod-ns" + }, + { + "name": "cpfrun_cluster_name", + "value": "CI-PDK1-TFINIT-CJ9125401" + } + ], + "disableType": [] + } + ] +}
\ No newline at end of file diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java index a7ce2da70d..4025e348f8 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java @@ -87,6 +87,10 @@ public class NorthBoundRequest implements Serializable { @Column(name = "CLOUD_OWNER") private String cloudOwner; + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest") private List<OrchestrationFlow> orchestrationFlowList; @@ -95,7 +99,7 @@ public class NorthBoundRequest implements Serializable { return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope) .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow) .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion) - .append("cloudOwner",cloudOwner).toString(); + .append("cloudOwner",cloudOwner).append("serviceType",serviceType).toString(); } @Override @@ -107,14 +111,14 @@ public class NorthBoundRequest implements Serializable { return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope) .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow) .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion) - .append(cloudOwner, castOther.cloudOwner) + .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow) - .append(minApiVersion).append(maxApiVersion).append(cloudOwner).toHashCode(); + .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode(); } public Integer getId() { @@ -188,6 +192,14 @@ public class NorthBoundRequest implements Serializable { public void setCloudOwner(String cloudOwner) { this.cloudOwner = cloudOwner; } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } @LinkedResource public List<OrchestrationFlow> getOrchestrationFlowList() { diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index 51c55bdfce..3612d83359 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -128,6 +128,7 @@ public class CatalogDbClient { private static final String CLOUD_VERSION = "cloudVersion"; private static final String TARGET_ENTITY = "SO:CatalogDB"; + private static final String ASTERISK = "*"; private String findExternalToInternalServiceByServiceName = "/findByServiceName"; private String findServiceByModelName = "/findOneByModelName"; @@ -153,6 +154,7 @@ public class CatalogDbClient { private String findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = "/findByModelCustomizationUUID"; private String findOneByActionAndRequestScopeAndIsAlacarte = "/findOneByActionAndRequestScopeAndIsAlacarte"; private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner"; + private String findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = "/findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType"; private String findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = "/findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep"; private String findByClliAndCloudVersion = "/findByClliAndCloudVersion"; @@ -251,6 +253,7 @@ public class CatalogDbClient { findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID = endpoint + COLLECTION_RESOURCE_INSTANCE_GROUP_CUSTOMIZATION + SEARCH + findCollectionResourceInstanceGroupCustomizationByModelCustomizationUUID; findOneByActionAndRequestScopeAndIsAlacarte = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarte; findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner; + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType = endpoint + NORTHBOUND_REQUEST_REF_LOOKUP + SEARCH + findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType; findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep = endpoint + RAINY_DAY_HANDLER_MACRO + SEARCH + findOneByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep; findByClliAndCloudVersion = endpoint + CLOUD_SITE + SEARCH + findByClliAndCloudVersion; @@ -484,10 +487,21 @@ public class CatalogDbClient { public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwner(String requestAction, String resourceName, boolean aLaCarte, String cloudOwner) { return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder - .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner) + .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType) .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) .queryParam(IS_ALACARTE, aLaCarte) - .queryParam(CLOUD_OWNER, cloudOwner).build().toString())); + .queryParam(CLOUD_OWNER, cloudOwner) + .queryParam(SERVICE_TYPE, ASTERISK).build().toString())); + } + + public NorthBoundRequest getNorthBoundRequestByActionAndIsALaCarteAndRequestScopeAndCloudOwnerAndServiceType(String requestAction, + String resourceName, boolean aLaCarte, String cloudOwner, String serviceType) { + return this.getSingleResource(northBoundRequestClient, getUri(UriBuilder + .fromUri(findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType) + .queryParam(ACTION, requestAction).queryParam(REQUEST_SCOPE, resourceName) + .queryParam(IS_ALACARTE, aLaCarte) + .queryParam(CLOUD_OWNER, cloudOwner) + .queryParam(SERVICE_TYPE, serviceType).build().toString())); } public RainyDayHandlerStatus getRainyDayHandlerStatusByFlowNameAndServiceTypeAndVnfTypeAndErrorCodeAndWorkStep( diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java index 11a2a34aaf..09732c2d8b 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/NorthBoundRequestRepository.java @@ -28,4 +28,5 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource; public interface NorthBoundRequestRepository extends JpaRepository<NorthBoundRequest, Integer> { NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarte(String action, String requestScope, Boolean isALaCarte); NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwner(String action, String requestScope, Boolean isALaCarte, String cloudOwner); + NorthBoundRequest findOneByActionAndRequestScopeAndIsAlacarteAndCloudOwnerAndServiceType(String action, String requestScope, Boolean isALaCarte, String cloudOwner, String serviceType); } diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ActivityInstance.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ActivityInstance.java index 10ca6c9ac3..f92d9fcbfe 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ActivityInstance.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ActivityInstance.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.camunda.model; +package org.onap.so.monitoring.camunda.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessDefinition.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessDefinition.java index ccddf0cd95..c38cbcf5c3 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessDefinition.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessDefinition.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.camunda.model; +package org.onap.so.monitoring.camunda.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessInstance.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessInstance.java index faea7b3bf9..0a2db7dea7 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessInstance.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessInstance.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.camunda.model; +package org.onap.so.monitoring.camunda.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessInstanceVariable.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessInstanceVariable.java index 14a01b96bb..4154133cce 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessInstanceVariable.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessInstanceVariable.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.camunda.model; +package org.onap.so.monitoring.camunda.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/SoActiveInfraRequests.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/SoActiveInfraRequests.java index b17cad23b5..124101a999 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/SoActiveInfraRequests.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/SoActiveInfraRequests.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.camunda.model; +package org.onap.so.monitoring.camunda.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/camunda/CamundaConfiguration.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/camunda/CamundaConfiguration.java index 2540eda04b..e5194da8f0 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/camunda/CamundaConfiguration.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/camunda/CamundaConfiguration.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.camunda; +package org.onap.so.monitoring.configuration.camunda; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/camunda/CamundaRestUrlProvider.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/camunda/CamundaRestUrlProvider.java index 9a509f037b..dc887bbac1 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/camunda/CamundaRestUrlProvider.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/camunda/CamundaRestUrlProvider.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.camunda; +package org.onap.so.monitoring.configuration.camunda; import java.net.URI; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/database/DatabaseConfiguration.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/database/DatabaseConfiguration.java index 3d2b529d9a..359c334cde 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/database/DatabaseConfiguration.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/database/DatabaseConfiguration.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.database; +package org.onap.so.monitoring.configuration.database; import org.springframework.beans.factory.annotation.Value; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/database/DatabaseUrlProvider.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/database/DatabaseUrlProvider.java index 8235b9272b..7531cfcf7e 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/database/DatabaseUrlProvider.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/database/DatabaseUrlProvider.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.database; +package org.onap.so.monitoring.configuration.database; import java.net.URI; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java index 0db1e51ce2..34afd825cb 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.rest; +package org.onap.so.monitoring.configuration.rest; import java.io.IOException; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java new file mode 100644 index 0000000000..557e2a63b7 --- /dev/null +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * Copyright (C) 2018 Ericsson. 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. + * + * SPDX-License-Identifier: Apache-2.0 + * ============LICENSE_END========================================================= + */ + +package org.onap.so.monitoring.configuration.rest; + +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.Ordered; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +import java.util.concurrent.TimeUnit; + +/** + * @author waqas.ikram@ericsson, eoin.hanan@ericsson.com + */ +@Configuration +public class CorsConfigurer { + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + config.addAllowedOrigin("*"); + config.addAllowedHeader("*"); + config.addAllowedMethod("*"); + source.registerCorsConfiguration("/**", config); + return new CorsFilter(source); + } +} + + diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/HttpClientConnectionConfiguration.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpClientConnectionConfiguration.java index a465b53c71..1260e535a1 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/HttpClientConnectionConfiguration.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpClientConnectionConfiguration.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.rest; +package org.onap.so.monitoring.configuration.rest; import java.util.concurrent.TimeUnit; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/HttpServiceProviderConfiguration.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java index 31cd12bebc..a590d7908f 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/HttpServiceProviderConfiguration.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java @@ -17,13 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.rest; +package org.onap.so.monitoring.configuration.rest; -import static org.onap.so.montoring.configuration.rest.RestTemplateConfigration.CAMUNDA_REST_TEMPLATE; -import static org.onap.so.montoring.configuration.rest.RestTemplateConfigration.DATABASE_REST_TEMPLATE; +import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.CAMUNDA_REST_TEMPLATE; +import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.DATABASE_REST_TEMPLATE; -import org.onap.so.montoring.rest.service.HttpRestServiceProvider; -import org.onap.so.montoring.rest.service.HttpRestServiceProviderImpl; +import org.onap.so.monitoring.rest.service.HttpRestServiceProvider; +import org.onap.so.monitoring.rest.service.HttpRestServiceProviderImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Value; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/RestTemplateConfigration.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/RestTemplateConfiguration.java index a30628b1d5..f8f0f687cf 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/RestTemplateConfigration.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/RestTemplateConfiguration.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.rest; +package org.onap.so.monitoring.configuration.rest; import java.util.concurrent.TimeUnit; @@ -37,7 +37,7 @@ import org.springframework.web.client.RestTemplate; * @author waqas.ikram@ericsson.com */ @Configuration -public class RestTemplateConfigration { +public class RestTemplateConfiguration { public static final String DATABASE_REST_TEMPLATE = "databaseRestTemplate"; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/db/service/DatabaseServiceProvider.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProvider.java index b8481803e2..209fac8fe1 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/db/service/DatabaseServiceProvider.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProvider.java @@ -17,12 +17,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.db.service; +package org.onap.so.monitoring.db.service; import java.util.List; import java.util.Map; -import org.onap.so.montoring.model.SoInfraRequest; +import org.onap.so.monitoring.model.SoInfraRequest; /** diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/db/service/DatabaseServiceProviderImpl.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java index f6cbc3c297..6be6367302 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/db/service/DatabaseServiceProviderImpl.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java @@ -17,20 +17,20 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.db.service; +package org.onap.so.monitoring.db.service; -import static org.onap.so.montoring.configuration.rest.HttpServiceProviderConfiguration.DATABASE_HTTP_REST_SERVICE_PROVIDER; +import static org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration.DATABASE_HTTP_REST_SERVICE_PROVIDER; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; -import org.onap.so.montoring.camunda.model.SoActiveInfraRequests; -import org.onap.so.montoring.configuration.database.DatabaseUrlProvider; -import org.onap.so.montoring.model.SoInfraRequest; -import org.onap.so.montoring.model.SoInfraRequestBuilder; -import org.onap.so.montoring.rest.service.HttpRestServiceProvider; +import org.onap.so.monitoring.camunda.model.SoActiveInfraRequests; +import org.onap.so.monitoring.configuration.database.DatabaseUrlProvider; +import org.onap.so.monitoring.model.SoInfraRequest; +import org.onap.so.monitoring.model.SoInfraRequestBuilder; +import org.onap.so.monitoring.rest.service.HttpRestServiceProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/exception/InvalidRestRequestException.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/InvalidRestRequestException.java index 8e4c751c8e..4d3c489fa9 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/exception/InvalidRestRequestException.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/InvalidRestRequestException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.exception; +package org.onap.so.monitoring.exception; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/exception/RestProcessingException.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/RestProcessingException.java index 2d3544ed66..ab25854542 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/exception/RestProcessingException.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/RestProcessingException.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.exception; +package org.onap.so.monitoring.exception; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ActivityInstanceDetail.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ActivityInstanceDetail.java index 5691f23622..2b26a4a25c 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ActivityInstanceDetail.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ActivityInstanceDetail.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessDefinitionDetail.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessDefinitionDetail.java index 164a3921c0..5e988f6aa6 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessDefinitionDetail.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessDefinitionDetail.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceDetail.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceDetail.java index a96b6c3a0f..2f8e756b8c 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceDetail.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceDetail.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceIdDetail.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceIdDetail.java index b0bb7acc75..06a08f2027 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceIdDetail.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceIdDetail.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceVariableDetail.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceVariableDetail.java index 9674dfea4d..a52121d7c5 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceVariableDetail.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceVariableDetail.java @@ -17,12 +17,12 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; /** * @author waqas.ikram@ericsson.com */ -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; public class ProcessInstanceVariableDetail { diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/SoInfraRequest.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/SoInfraRequest.java index ca392496eb..e16cd14598 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/SoInfraRequest.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/SoInfraRequest.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; -import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual; +import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/SoInfraRequestBuilder.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/SoInfraRequestBuilder.java index 3b996f758e..cdaf7641c8 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/SoInfraRequestBuilder.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/SoInfraRequestBuilder.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.model; +package org.onap.so.monitoring.model; import java.sql.Timestamp; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProvider.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProvider.java index 81e30f1176..e0e0432452 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProvider.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProvider.java @@ -17,15 +17,15 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.rest.service; +package org.onap.so.monitoring.rest.service; import java.util.List; -import org.onap.so.montoring.model.ActivityInstanceDetail; -import org.onap.so.montoring.model.ProcessDefinitionDetail; -import org.onap.so.montoring.model.ProcessInstanceDetail; -import org.onap.so.montoring.model.ProcessInstanceIdDetail; -import org.onap.so.montoring.model.ProcessInstanceVariableDetail; +import org.onap.so.monitoring.model.ActivityInstanceDetail; +import org.onap.so.monitoring.model.ProcessDefinitionDetail; +import org.onap.so.monitoring.model.ProcessInstanceDetail; +import org.onap.so.monitoring.model.ProcessInstanceIdDetail; +import org.onap.so.monitoring.model.ProcessInstanceVariableDetail; import com.google.common.base.Optional; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderImpl.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java index 2515c8f79b..e6fbb68456 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderImpl.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java @@ -17,24 +17,24 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.rest.service; +package org.onap.so.monitoring.rest.service; -import static org.onap.so.montoring.configuration.rest.HttpServiceProviderConfiguration.CAMUNDA_HTTP_REST_SERVICE_PROVIDER; +import static org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration.CAMUNDA_HTTP_REST_SERVICE_PROVIDER; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import org.onap.so.montoring.camunda.model.ActivityInstance; -import org.onap.so.montoring.camunda.model.ProcessDefinition; -import org.onap.so.montoring.camunda.model.ProcessInstance; -import org.onap.so.montoring.camunda.model.ProcessInstanceVariable; -import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider; -import org.onap.so.montoring.model.ActivityInstanceDetail; -import org.onap.so.montoring.model.ProcessDefinitionDetail; -import org.onap.so.montoring.model.ProcessInstanceDetail; -import org.onap.so.montoring.model.ProcessInstanceIdDetail; -import org.onap.so.montoring.model.ProcessInstanceVariableDetail; +import org.onap.so.monitoring.camunda.model.ActivityInstance; +import org.onap.so.monitoring.camunda.model.ProcessDefinition; +import org.onap.so.monitoring.camunda.model.ProcessInstance; +import org.onap.so.monitoring.camunda.model.ProcessInstanceVariable; +import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider; +import org.onap.so.monitoring.model.ActivityInstanceDetail; +import org.onap.so.monitoring.model.ProcessDefinitionDetail; +import org.onap.so.monitoring.model.ProcessInstanceDetail; +import org.onap.so.monitoring.model.ProcessInstanceIdDetail; +import org.onap.so.monitoring.model.ProcessInstanceVariableDetail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Service; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/HttpRestServiceProvider.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java index eb80ddcd78..4606c04e05 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/HttpRestServiceProvider.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.rest.service; +package org.onap.so.monitoring.rest.service; import com.google.common.base.Optional; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/HttpRestServiceProviderImpl.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProviderImpl.java index b5cafcf1ed..82a54c10a2 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/HttpRestServiceProviderImpl.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProviderImpl.java @@ -17,10 +17,10 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.rest.service; +package org.onap.so.monitoring.rest.service; -import org.onap.so.montoring.exception.InvalidRestRequestException; -import org.onap.so.montoring.exception.RestProcessingException; +import org.onap.so.monitoring.exception.InvalidRestRequestException; +import org.onap.so.monitoring.exception.RestProcessingException; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/utils/ObjectEqualsUtils.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/utils/ObjectEqualsUtils.java index 496ad26bea..d8e331baae 100644 --- a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/utils/ObjectEqualsUtils.java +++ b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/utils/ObjectEqualsUtils.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.utils; +package org.onap.so.monitoring.utils; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java index de891dd01b..fb56d841e4 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java @@ -17,13 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration; +package org.onap.so.monitoring.configuration; import static org.junit.Assert.assertEquals; import org.junit.Test; -import org.onap.so.montoring.configuration.camunda.CamundaConfiguration; -import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider; +import org.onap.so.monitoring.configuration.camunda.CamundaConfiguration; +import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider; /** diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java index 5fa9b447e6..3cd8a33d77 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java @@ -17,14 +17,14 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration; +package org.onap.so.monitoring.configuration; import static org.junit.Assert.assertEquals; import java.util.UUID; import org.junit.Test; -import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider; +import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider; /** * @author waqas.ikram@ericsson.com diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java index 13a2f98d57..1b3e168c12 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java @@ -17,13 +17,13 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration; +package org.onap.so.monitoring.configuration; import static org.junit.Assert.assertNotNull; import org.junit.Test; -import org.onap.so.montoring.configuration.rest.HttpServiceProviderConfiguration; -import org.onap.so.montoring.rest.service.HttpRestServiceProvider; +import org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration; +import org.onap.so.monitoring.rest.service.HttpRestServiceProvider; import org.springframework.web.client.RestTemplate; /** diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java index 93dfa79990..f51d4c64b1 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration; +package org.onap.so.monitoring.configuration; import static org.junit.Assert.assertFalse; @@ -46,14 +46,14 @@ public class PojoClassesTests { @Test public void test_camunda_module_pojo_classes() throws ClassNotFoundException { - test("org.onap.so.montoring.camunda.model"); - assertEqualMethod("org.onap.so.montoring.camunda.model"); + test("org.onap.so.monitoring.camunda.model"); + assertEqualMethod("org.onap.so.monitoring.camunda.model"); } @Test public void test_so_monitoring_pojo_classes() throws ClassNotFoundException { - test("org.onap.so.montoring.model"); - assertEqualMethod("org.onap.so.montoring.model"); + test("org.onap.so.monitoring.model"); + assertEqualMethod("org.onap.so.monitoring.model"); } public void assertEqualMethod(final String pojoPackage) throws ClassNotFoundException { diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java index d9d260992d..d820e9435d 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.configuration.database; +package org.onap.so.monitoring.configuration.database; import static org.junit.Assert.assertEquals; diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java index 3bb7b289e4..8c06426217 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.db.api; +package org.onap.so.monitoring.db.api; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -33,12 +33,12 @@ import java.util.Map; import java.util.UUID; import org.junit.Test; -import org.onap.so.montoring.camunda.model.SoActiveInfraRequests; -import org.onap.so.montoring.configuration.database.DatabaseUrlProvider; -import org.onap.so.montoring.db.service.DatabaseServiceProvider; -import org.onap.so.montoring.db.service.DatabaseServiceProviderImpl; -import org.onap.so.montoring.model.SoInfraRequest; -import org.onap.so.montoring.rest.service.HttpRestServiceProvider; +import org.onap.so.monitoring.camunda.model.SoActiveInfraRequests; +import org.onap.so.monitoring.configuration.database.DatabaseUrlProvider; +import org.onap.so.monitoring.db.service.DatabaseServiceProvider; +import org.onap.so.monitoring.db.service.DatabaseServiceProviderImpl; +import org.onap.so.monitoring.model.SoInfraRequest; +import org.onap.so.monitoring.rest.service.HttpRestServiceProvider; import com.google.common.base.Optional; diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java index 351c476ca1..c3930df196 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.rest.service; +package org.onap.so.monitoring.rest.service; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -29,15 +29,15 @@ import java.util.List; import java.util.UUID; import org.junit.Test; -import org.onap.so.montoring.camunda.model.ActivityInstance; -import org.onap.so.montoring.camunda.model.ProcessDefinition; -import org.onap.so.montoring.camunda.model.ProcessInstance; -import org.onap.so.montoring.camunda.model.ProcessInstanceVariable; -import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider; -import org.onap.so.montoring.model.ActivityInstanceDetail; -import org.onap.so.montoring.model.ProcessDefinitionDetail; -import org.onap.so.montoring.model.ProcessInstanceIdDetail; -import org.onap.so.montoring.model.ProcessInstanceVariableDetail; +import org.onap.so.monitoring.camunda.model.ActivityInstance; +import org.onap.so.monitoring.camunda.model.ProcessDefinition; +import org.onap.so.monitoring.camunda.model.ProcessInstance; +import org.onap.so.monitoring.camunda.model.ProcessInstanceVariable; +import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider; +import org.onap.so.monitoring.model.ActivityInstanceDetail; +import org.onap.so.monitoring.model.ProcessDefinitionDetail; +import org.onap.so.monitoring.model.ProcessInstanceIdDetail; +import org.onap.so.monitoring.model.ProcessInstanceVariableDetail; import com.google.common.base.Optional; diff --git a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java index b1ad4eae12..dd363abe3a 100644 --- a/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java +++ b/so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java @@ -17,7 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ -package org.onap.so.montoring.utils; +package org.onap.so.monitoring.utils; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java index de2263be3f..155b4e65a4 100644 --- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java +++ b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java @@ -32,16 +32,16 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import org.onap.so.montoring.db.service.DatabaseServiceProvider; -import org.onap.so.montoring.exception.InvalidRestRequestException; -import org.onap.so.montoring.exception.RestProcessingException; -import org.onap.so.montoring.model.ActivityInstanceDetail; -import org.onap.so.montoring.model.ProcessDefinitionDetail; -import org.onap.so.montoring.model.ProcessInstanceDetail; -import org.onap.so.montoring.model.ProcessInstanceIdDetail; -import org.onap.so.montoring.model.ProcessInstanceVariableDetail; -import org.onap.so.montoring.model.SoInfraRequest; -import org.onap.so.montoring.rest.service.CamundaProcessDataServiceProvider; +import org.onap.so.monitoring.db.service.DatabaseServiceProvider; +import org.onap.so.monitoring.exception.InvalidRestRequestException; +import org.onap.so.monitoring.exception.RestProcessingException; +import org.onap.so.monitoring.model.ActivityInstanceDetail; +import org.onap.so.monitoring.model.ProcessDefinitionDetail; +import org.onap.so.monitoring.model.ProcessInstanceDetail; +import org.onap.so.monitoring.model.ProcessInstanceIdDetail; +import org.onap.so.monitoring.model.ProcessInstanceVariableDetail; +import org.onap.so.monitoring.model.SoInfraRequest; +import org.onap.so.monitoring.rest.service.CamundaProcessDataServiceProvider; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; diff --git a/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java b/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java index 13953b0331..ca2a88d4a8 100644 --- a/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java +++ b/so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java @@ -22,7 +22,7 @@ package org.onap.so.monitoring.rest.api; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; -import static org.onap.so.montoring.configuration.rest.RestTemplateConfigration.CAMUNDA_REST_TEMPLATE; +import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.CAMUNDA_REST_TEMPLATE; import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withBadRequest; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; @@ -41,12 +41,12 @@ import javax.ws.rs.core.Response.Status; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider; -import org.onap.so.montoring.model.ActivityInstanceDetail; -import org.onap.so.montoring.model.ProcessDefinitionDetail; -import org.onap.so.montoring.model.ProcessInstanceDetail; -import org.onap.so.montoring.model.ProcessInstanceIdDetail; -import org.onap.so.montoring.model.ProcessInstanceVariableDetail; +import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider; +import org.onap.so.monitoring.model.ActivityInstanceDetail; +import org.onap.so.monitoring.model.ProcessDefinitionDetail; +import org.onap.so.monitoring.model.ProcessInstanceDetail; +import org.onap.so.monitoring.model.ProcessInstanceIdDetail; +import org.onap.so.monitoring.model.ProcessInstanceVariableDetail; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.test.context.SpringBootTest; diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts index 796739077c..2e8f4237f7 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts @@ -30,6 +30,7 @@ import { environment } from '../environments/environment'; import { HttpResponse } from '@angular/common/http';
import { PII } from './model/processInstance.model';
import { HttpErrorHandlerService } from './http-error-handler.service';
+import { ACTINST } from './model/activityInstance.model';
@Injectable({
@@ -59,12 +60,12 @@ export class DataService { }
// HTTP GET to return Activity instancs using ProcessInstanceID
- getActivityInstance(processInstanceId) {
+ getActivityInstance(processInstanceId): Promise<ACTINST[]> {
var url = environment.soMonitoringBackendURL + 'activity-instance/' + processInstanceId;
- return this.http.get(url)
+ return this.http.get<ACTINST[]>(url)
.pipe(
catchError(this.httpErrorHandlerService.handleError("GET", url))
- );
+ ).toPromise();
}
// HTTP GET to return Activity Instance using ProcessInstanceID
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html index 45301c7945..a98095ca00 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html @@ -1,101 +1,101 @@ -<!--
-============LICENSE_START=======================================================
- Copyright (C) 2018 Ericsson. 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.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
--->
-
-<div class="completeForm">
- <div class="topCanvas">
- <section class="canvas" id="canvas"></section>
- <mat-card class="besideCanvas" id="besideCanvas">
- <mat-card-title>Process Information</mat-card-title>
- <br />
- <mat-card-content>Process Instance Id: </mat-card-content>
- <mat-card-content>{{ processInstanceID }}</mat-card-content>
- <br />
- <mat-card-content>Process Definition Id: </mat-card-content>
- <mat-card-content>{{ processDefinitionID }}</mat-card-content>
- <br />
- <mat-card-content>Process Definition Name: </mat-card-content>
- <mat-card-content>{{ processDefinitionName }}</mat-card-content>
- </mat-card>
- </div>
- <br />
-
- <div class="example-container mat-elevation-z8">
- <mat-tab-group class="tab-group">
- <mat-tab label="Activity Instances">
- <mat-table [dataSource]="activityInstance">
- <ng-container matColumnDef="activityId">
- <mat-header-cell *matHeaderCellDef> Activity Id </mat-header-cell>
- <mat-cell *matCellDef="let activity"> {{ activity.activityId }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="activityName">
- <mat-header-cell *matHeaderCellDef> Activity Name </mat-header-cell>
- <mat-cell *matCellDef="let activity">
- <div [ngSwitch]="!!activity.calledProcessInstanceId">
- <div *ngSwitchCase="false"><a> {{ activity.activityName }} </a></div>
- <div *ngSwitchCase="true"><a [routerLink]="['/details', activity.calledProcessInstanceId]"> {{ activity.activityName }} </a></div>
- </div>
- </mat-cell>
- </ng-container>
- <ng-container matColumnDef="activityType">
- <mat-header-cell *matHeaderCellDef> Activity Type </mat-header-cell>
- <mat-cell *matCellDef="let activity"> {{ activity.activityType }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="startTime">
- <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell>
- <mat-cell *matCellDef="let activity"> {{ activity.startTime }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="endTime">
- <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell>
- <mat-cell *matCellDef="let activity"> {{ activity.endTime }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="durationInMillis">
- <mat-header-cell *matHeaderCellDef> Duration (ms) </mat-header-cell>
- <mat-cell *matCellDef="let activity"> {{ activity.durationInMillis }} </mat-cell>
- </ng-container>
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
- <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
- </mat-table>
- </mat-tab>
-
- <mat-tab label="Variable Instances">
- <mat-table [dataSource]="variableInstance">
- <ng-container matColumnDef="name">
- <mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
- <mat-cell *matCellDef="let variable"> {{ variable.name }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="type">
- <mat-header-cell *matHeaderCellDef> Type </mat-header-cell>
- <mat-cell *matCellDef="let variable"> {{ variable.type }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="value">
- <mat-header-cell *matHeaderCellDef> Value </mat-header-cell>
- <mat-cell *matCellDef="let variable"> {{ variable.value }} </mat-cell>
- </ng-container>
- <mat-header-row *matHeaderRowDef="displayedColumnsVariable"></mat-header-row>
- <mat-row *matRowDef="let row; columns: displayedColumnsVariable;"></mat-row>
- </mat-table>
- </mat-tab>
- </mat-tab-group>
- </div>
-</div>
-
-<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner>
+<!-- +============LICENSE_START======================================================= + Copyright (C) 2018 Ericsson. 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. + +SPDX-License-Identifier: Apache-2.0 +============LICENSE_END========================================================= + +@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com +--> + +<div class="completeForm"> + <div class="topCanvas"> + <section class="canvas" id="canvas"></section> + <mat-card class="besideCanvas" id="besideCanvas"> + <mat-card-title>Process Information</mat-card-title> + <br /> + <mat-card-content>Process Instance Id: </mat-card-content> + <mat-card-content>{{ processInstanceID }}</mat-card-content> + <br /> + <mat-card-content>Process Definition Id: </mat-card-content> + <mat-card-content>{{ processDefinitionID }}</mat-card-content> + <br /> + <mat-card-content>Process Definition Name: </mat-card-content> + <mat-card-content>{{ processDefinitionName }}</mat-card-content> + </mat-card> + </div> + <br /> + + <div class="example-container mat-elevation-z8"> + <mat-tab-group class="tab-group"> + <mat-tab label="Activity Instances"> + <mat-table [dataSource]="activityInstance"> + <ng-container matColumnDef="activityId"> + <mat-header-cell *matHeaderCellDef> Activity Id </mat-header-cell> + <mat-cell *matCellDef="let activity"> {{ activity.activityId }} </mat-cell> + </ng-container> + <ng-container matColumnDef="activityName"> + <mat-header-cell *matHeaderCellDef> Activity Name </mat-header-cell> + <mat-cell *matCellDef="let activity"> + <div [ngSwitch]="!!activity.calledProcessInstanceId"> + <div *ngSwitchCase="false"><a> {{ activity.activityName }} </a></div> + <div *ngSwitchCase="true"><a [routerLink]="['/details', activity.calledProcessInstanceId]"> {{ activity.activityName }} </a></div> + </div> + </mat-cell> + </ng-container> + <ng-container matColumnDef="activityType"> + <mat-header-cell *matHeaderCellDef> Activity Type </mat-header-cell> + <mat-cell *matCellDef="let activity"> {{ activity.activityType }} </mat-cell> + </ng-container> + <ng-container matColumnDef="startTime"> + <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell> + <mat-cell *matCellDef="let activity"> {{ (activity.startTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell> + </ng-container> + <ng-container matColumnDef="endTime"> + <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell> + <mat-cell *matCellDef="let activity"> {{ (activity.endTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell> + </ng-container> + <ng-container matColumnDef="durationInMillis"> + <mat-header-cell *matHeaderCellDef> Duration (ms) </mat-header-cell> + <mat-cell *matCellDef="let activity"> {{ activity.durationInMillis }} </mat-cell> + </ng-container> + <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> + <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> + </mat-table> + </mat-tab> + + <mat-tab label="Variable Instances"> + <mat-table [dataSource]="variableInstance"> + <ng-container matColumnDef="name"> + <mat-header-cell *matHeaderCellDef> Name </mat-header-cell> + <mat-cell *matCellDef="let variable"> {{ variable.name }} </mat-cell> + </ng-container> + <ng-container matColumnDef="type"> + <mat-header-cell *matHeaderCellDef> Type </mat-header-cell> + <mat-cell *matCellDef="let variable"> {{ variable.type }} </mat-cell> + </ng-container> + <ng-container matColumnDef="value"> + <mat-header-cell *matHeaderCellDef> Value </mat-header-cell> + <mat-cell *matCellDef="let variable"> {{ variable.value }} </mat-cell> + </ng-container> + <mat-header-row *matHeaderRowDef="displayedColumnsVariable"></mat-header-row> + <mat-row *matRowDef="let row; columns: displayedColumnsVariable;"></mat-row> + </mat-table> + </mat-tab> + </mat-tab-group> + </div> +</div> + +<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner> diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts index 4c19ba1039..97bbbdad02 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts @@ -43,7 +43,6 @@ import { NgxSpinnerService } from 'ngx-spinner'; })
export class DetailsComponent implements OnInit {
-
bpmnViewer: any;
processInstanceID: string;
@@ -67,8 +66,8 @@ export class DetailsComponent implements OnInit { constructor(private route: ActivatedRoute, private data: DataService, private popup: ToastrNotificationService,
private router: Router, private spinner: NgxSpinnerService) { }
- getActInst(procInstId: string) {
- this.data.getActivityInstance(procInstId).subscribe(
+ async getActInst(procInstId: string) {
+ await this.data.getActivityInstance(procInstId).then(
(data: ACTINST[]) => {
this.activityInstance = data;
console.log(data);
@@ -90,7 +89,7 @@ export class DetailsComponent implements OnInit { });
}
- async getProcInstance(procInstId) {
+ async getProcInstance(procInstId) {
await this.data.getProcessInstance(procInstId).then(
async (data: PII) => {
this.processInstance = data;
@@ -139,7 +138,20 @@ export class DetailsComponent implements OnInit { getVarInst(procInstId) {
this.data.getVariableInstance(procInstId).subscribe(
(data: VarInstance[]) => {
- this.variableInstance = data;
+ this.variableInstance = [];
+ for (let i = 0; i < data.length; i++) {
+ var value = data[i]['value'];
+ var type = data[i]['type'];
+ if ((type == 'Object') && !(value == null)) {
+ try {
+ data[i]['value'] = JSON.stringify(value, null, 2);
+ }
+ catch (error) {
+ console.log("Unable to \nError Code: " + error);
+ }
+ }
+ this.variableInstance[i] = data[i];
+ }
console.log(data);
}, error => {
console.log(error);
@@ -160,4 +172,5 @@ export class DetailsComponent implements OnInit { this.getVarInst(this.processInstanceID);
});
}
+
}
diff --git a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/home/home.component.html b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/home/home.component.html index 2b580e26a1..e4556ca840 100644 --- a/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/home/home.component.html +++ b/so-monitoring/so-monitoring-ui/src/main/frontend/src/app/home/home.component.html @@ -1,203 +1,203 @@ -<!--
-============LICENSE_START=======================================================
-Copyright (C) 2018 Ericsson. 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.
-
-SPDX-License-Identifier: Apache-2.0
-============LICENSE_END=========================================================
-
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
--->
-
-<base href="/">
-
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
-<link rel="stylesheet" ng-href="./home.component.scss">
-<div class="completeForm">
- <div class="searchArea">
-
- <!-- Dropdown Filter and TextBox for Service Instance Id -->
- <div class="container-home">
- <mat-form-field class="selectFilter">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSII" name="sel" placeholder="Select Filter">
- <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>
- </mat-select>
- </mat-form-field>
- <mat-form-field class="valueInput">
- <input matInput #searchValueSII type="text" [(ngModel)]="searchData.serviceInstanceId" placeholder="Service Instance Id">
- </mat-form-field>
- </div>
-
- <!-- Dropdown Filter and TextBox for Request Id -->
- <div class="container-home">
- <mat-form-field class="selectFilter">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueRI" name="sel" placeholder="Select Filter">
- <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>
- </mat-select>
- </mat-form-field>
- <mat-form-field class="valueInput">
- <input matInput #searchValueRI type="text" [(ngModel)]="searchData.requestId" placeholder="Request Id">
- </mat-form-field>
-
- <!-- Angular Start Date Picker -->
- <mat-form-field class="startDate">
- <input matInput #startDate [matDatepicker]="picker" [(ngModel)]="searchData.startDate" placeholder="Choose a start date">
- <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
- <mat-datepicker #picker></mat-datepicker>
- </mat-form-field>
-
- <!-- Dropdown box for Start Hour selection -->
- <mat-form-field class="selectHour">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartHour" name="hourFrom" placeholder="Select Hour">
- <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option>
- </mat-select>
- </mat-form-field>
-
- <!-- Dropdown box for Start Minute selection -->
- <mat-form-field class="selectMinute">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartMinute" name="minuteFrom" placeholder="Select Minute">
- <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option>
- </mat-select>
- </mat-form-field>
- </div>
-
- <!-- Dropdown Filter and TextBox for Service Name -->
- <div class="container-home">
- <mat-form-field class="selectFilter">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSN" name="sel" placeholder="Select Filter">
- <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>
- </mat-select>
- </mat-form-field>
- <mat-form-field class="valueInput">
- <input matInput #searchValueSN type="text" [(ngModel)]="searchData.serviceInstanceName" placeholder="Service Name">
- </mat-form-field>
-
- <!-- Angular End Date Picker -->
- <mat-form-field class="endDate">
- <input matInput #endDate [matDatepicker]="endpicker" [(ngModel)]="searchData.endDate" placeholder="Choose an end date">
- <mat-datepicker-toggle matSuffix [for]="endpicker"></mat-datepicker-toggle>
- <mat-datepicker #endpicker></mat-datepicker>
- </mat-form-field>
-
- <!-- Dropdown box for End Hour selection -->
- <mat-form-field class="selectHour">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndHour" name="hourTo" placeholder="Select Hour">
- <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option>
- </mat-select>
- </mat-form-field>
-
- <!-- Dropdown box for End Minute selection -->
- <mat-form-field class="selectMinute">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndMinute" name="minuteTo" placeholder="Select Minute">
- <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option>
- </mat-select>
- </mat-form-field>
- </div>
-
- <!-- Dropdown Filter for Status -->
- <div class="container-home">
- <mat-form-field class="selectFilter">
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSTATUS" name="sel" placeholder="Status">
- <mat-option *ngFor="let statusOption of statusOptions" [value]="statusOption.value">{{ statusOption.name }}</mat-option>
- </mat-select>
- </mat-form-field>
- </div>
- <br />
-
- <!-- Button to call makeCall() function to commence search based on parameters -->
- <button (click)="makeCall()" class="fa fa-search"></button>
- </div>
-
- <br />
-
- <!-- Table to display selected fields if data present -->
- <div class="example-container mat-elevation-z8">
- <mat-tab-group class="tab-group">
- <mat-tab label="Service Instances">
- <mat-table [dataSource]="processData">
- <ng-container matColumnDef="requestId">
- <mat-header-cell *matHeaderCellDef> Request Id </mat-header-cell>
- <mat-cell *matCellDef="let process"><a routerLink="" (click)="getProcessIsntanceId(process.requestId)">{{ process.requestId }}</a></mat-cell>
- </ng-container>
- <ng-container matColumnDef="serviceInstanceId">
- <mat-header-cell *matHeaderCellDef> Instance Id </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.serviceInstanceId }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="serviceIstanceName">
- <mat-header-cell *matHeaderCellDef> Instance Name </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.serviceIstanceName }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="networkId">
- <mat-header-cell *matHeaderCellDef> Network Id </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.networkId }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="requestStatus">
- <mat-header-cell *matHeaderCellDef> Request Status </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.requestStatus }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="serviceType">
- <mat-header-cell *matHeaderCellDef> Service Type </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.serviceType }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="startTime">
- <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.startTime }} </mat-cell>
- </ng-container>
- <ng-container matColumnDef="endTime">
- <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell>
- <mat-cell *matCellDef="let process"> {{ process.endTime }} </mat-cell>
- </ng-container>
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
- <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
- </mat-table>
- </mat-tab>
-
- <mat-tab label="Service Statistics">
- <div id="servStats">
- <table class="statsTable">
- <tbody>
- <tr>
- <td>Total: {{ totalVal }}</td>
- <td></td>
- </tr>
- <tr>
- <td>Complete: {{ completeVal }}</td>
- <td> {{ percentageComplete }}%</td>
- </tr>
- <tr>
- <td>Failed: {{ failedVal }}</td>
- <td> {{ percentageFailed }}%</td>
- </tr>
- <tr>
- <td>In Progress: {{ inProgressVal }}</td>
- <td> {{ percentageInProg }}%</td>
- </tr>
- <tr>
- <td>Pending: {{ pendingVal }}</td>
- <td> {{ percentagePending }}%</td>
- </tr>
- <tr>
- <td>Unlocked: {{ unlockedVal }}</td>
- <td> {{ percentageUnlocked }}%</td>
- </tr>
- </tbody>
- </table>
- </div>
- </mat-tab>
- </mat-tab-group>
- </div>
-</div>
-
-<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner>
-<router-outlet></router-outlet>
+<!-- +============LICENSE_START======================================================= +Copyright (C) 2018 Ericsson. 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. + +SPDX-License-Identifier: Apache-2.0 +============LICENSE_END========================================================= + +@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com +--> + +<base href="/"> + +<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> +<link rel="stylesheet" ng-href="./home.component.scss"> +<div class="completeForm"> + <div class="searchArea"> + + <!-- Dropdown Filter and TextBox for Service Instance Id --> + <div class="container-home"> + <mat-form-field class="selectFilter"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSII" name="sel" placeholder="Select Filter"> + <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option> + </mat-select> + </mat-form-field> + <mat-form-field class="valueInput"> + <input matInput #searchValueSII type="text" [(ngModel)]="searchData.serviceInstanceId" placeholder="Service Instance Id"> + </mat-form-field> + </div> + + <!-- Dropdown Filter and TextBox for Request Id --> + <div class="container-home"> + <mat-form-field class="selectFilter"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueRI" name="sel" placeholder="Select Filter"> + <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option> + </mat-select> + </mat-form-field> + <mat-form-field class="valueInput"> + <input matInput #searchValueRI type="text" [(ngModel)]="searchData.requestId" placeholder="Request Id"> + </mat-form-field> + + <!-- Angular Start Date Picker --> + <mat-form-field class="startDate"> + <input matInput #startDate [matDatepicker]="picker" [(ngModel)]="searchData.startDate" placeholder="Choose a start date"> + <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle> + <mat-datepicker #picker></mat-datepicker> + </mat-form-field> + + <!-- Dropdown box for Start Hour selection --> + <mat-form-field class="selectHour"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartHour" name="hourFrom" placeholder="Select Hour"> + <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option> + </mat-select> + </mat-form-field> + + <!-- Dropdown box for Start Minute selection --> + <mat-form-field class="selectMinute"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartMinute" name="minuteFrom" placeholder="Select Minute"> + <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option> + </mat-select> + </mat-form-field> + </div> + + <!-- Dropdown Filter and TextBox for Service Name --> + <div class="container-home"> + <mat-form-field class="selectFilter"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSN" name="sel" placeholder="Select Filter"> + <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option> + </mat-select> + </mat-form-field> + <mat-form-field class="valueInput"> + <input matInput #searchValueSN type="text" [(ngModel)]="searchData.serviceInstanceName" placeholder="Service Name"> + </mat-form-field> + + <!-- Angular End Date Picker --> + <mat-form-field class="endDate"> + <input matInput #endDate [matDatepicker]="endpicker" [(ngModel)]="searchData.endDate" placeholder="Choose an end date"> + <mat-datepicker-toggle matSuffix [for]="endpicker"></mat-datepicker-toggle> + <mat-datepicker #endpicker></mat-datepicker> + </mat-form-field> + + <!-- Dropdown box for End Hour selection --> + <mat-form-field class="selectHour"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndHour" name="hourTo" placeholder="Select Hour"> + <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option> + </mat-select> + </mat-form-field> + + <!-- Dropdown box for End Minute selection --> + <mat-form-field class="selectMinute"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndMinute" name="minuteTo" placeholder="Select Minute"> + <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option> + </mat-select> + </mat-form-field> + </div> + + <!-- Dropdown Filter for Status --> + <div class="container-home"> + <mat-form-field class="selectFilter"> + <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSTATUS" name="sel" placeholder="Status"> + <mat-option *ngFor="let statusOption of statusOptions" [value]="statusOption.value">{{ statusOption.name }}</mat-option> + </mat-select> + </mat-form-field> + </div> + <br /> + + <!-- Button to call makeCall() function to commence search based on parameters --> + <button (click)="makeCall()" class="fa fa-search"></button> + </div> + + <br /> + + <!-- Table to display selected fields if data present --> + <div class="example-container mat-elevation-z8"> + <mat-tab-group class="tab-group"> + <mat-tab label="Service Instances"> + <mat-table [dataSource]="processData"> + <ng-container matColumnDef="requestId"> + <mat-header-cell *matHeaderCellDef> Request Id </mat-header-cell> + <mat-cell *matCellDef="let process"><a routerLink="" (click)="getProcessIsntanceId(process.requestId)">{{ process.requestId }}</a></mat-cell> + </ng-container> + <ng-container matColumnDef="serviceInstanceId"> + <mat-header-cell *matHeaderCellDef> Instance Id </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ process.serviceInstanceId }} </mat-cell> + </ng-container> + <ng-container matColumnDef="serviceIstanceName"> + <mat-header-cell *matHeaderCellDef> Instance Name </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ process.serviceIstanceName }} </mat-cell> + </ng-container> + <ng-container matColumnDef="networkId"> + <mat-header-cell *matHeaderCellDef> Network Id </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ process.networkId }} </mat-cell> + </ng-container> + <ng-container matColumnDef="requestStatus"> + <mat-header-cell *matHeaderCellDef> Request Status </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ process.requestStatus }} </mat-cell> + </ng-container> + <ng-container matColumnDef="serviceType"> + <mat-header-cell *matHeaderCellDef> Service Type </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ process.serviceType }} </mat-cell> + </ng-container> + <ng-container matColumnDef="startTime"> + <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ (process.startTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell> + </ng-container> + <ng-container matColumnDef="endTime"> + <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell> + <mat-cell *matCellDef="let process"> {{ (process.endTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell> + </ng-container> + <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> + <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> + </mat-table> + </mat-tab> + + <mat-tab label="Service Statistics"> + <div id="servStats"> + <table class="statsTable"> + <tbody> + <tr> + <td>Total: {{ totalVal }}</td> + <td></td> + </tr> + <tr> + <td>Complete: {{ completeVal }}</td> + <td> {{ percentageComplete }}%</td> + </tr> + <tr> + <td>Failed: {{ failedVal }}</td> + <td> {{ percentageFailed }}%</td> + </tr> + <tr> + <td>In Progress: {{ inProgressVal }}</td> + <td> {{ percentageInProg }}%</td> + </tr> + <tr> + <td>Pending: {{ pendingVal }}</td> + <td> {{ percentagePending }}%</td> + </tr> + <tr> + <td>Unlocked: {{ unlockedVal }}</td> + <td> {{ percentageUnlocked }}%</td> + </tr> + </tbody> + </table> + </div> + </mat-tab> + </mat-tab-group> + </div> +</div> + +<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner> +<router-outlet></router-outlet> 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 003abf946f..f0c63fe582 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:9091/so/monitoring/' + soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/' }; |