diff options
6 files changed, 52 insertions, 22 deletions
diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy index 59b34c4074..79b40ba385 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy @@ -57,9 +57,10 @@ abstract class MsoGroovyTest { protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString(); protected void init(String procName){ - mockExecution = setupMock(procName) - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + // mockExecution = setupMock(procName) + // when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") client = mock(AAIResourcesClient.class) + mockExecution = mock(ExecutionEntity.class) } protected ExecutionEntity setupMock(String procName) { diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy index 99b178c044..39aadd29d7 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModuleTest.groovy @@ -25,7 +25,7 @@ import org.junit.rules.ExpectedException import static org.mockito.Mockito.* import javax.ws.rs.NotFoundException - +import org.camunda.bpm.engine.ProcessEngineServices import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity import org.junit.Before @@ -57,6 +57,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { void init() throws IOException { super.init("UpdateAAIVfModule") when(updateAAIVfModule.getAAIClient()).thenReturn(client) + mockExecution = setupMock("UpdateAAIVfModule") } @Test @@ -110,7 +111,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { when(mockExecution.getVariable(prefix + "getVfModuleResponse")).thenReturn(vfModule) doNothing().when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) updateAAIVfModule.updateVfModule(mockExecution) - verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200) + verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 200) } @Test @@ -126,7 +127,7 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { doThrow(new NotFoundException("Vf Module not found")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) thrown.expect(BpmnError.class) updateAAIVfModule.updateVfModule(mockExecution) - verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404) + verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 404) } @@ -143,7 +144,6 @@ class UpdateAAIVfModuleTest extends MsoGroovyTest { doThrow(new IllegalStateException("Error in AAI client")).when(client).update(isA(AAIResourceUri.class) as AAIResourceUri, anyObject()) thrown.expect(BpmnError.class) updateAAIVfModule.updateVfModule(mockExecution) - verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500) - + verify(mockExecution).setVariable("UAAIVfMod_updateVfModuleResponseCode", 500) } } diff --git a/deployment-configs/src/main/resources/logger/logback-spring.xml b/deployment-configs/src/main/resources/logger/logback-spring.xml index 3f022f55fb..76dbc1d1ab 100644 --- a/deployment-configs/src/main/resources/logger/logback-spring.xml +++ b/deployment-configs/src/main/resources/logger/logback-spring.xml @@ -157,6 +157,7 @@ <pattern>${debugPattern}</pattern> </encoder> </appender> + <appender name="asyncDebug" class="ch.qos.logback.classic.AsyncAppender"> <queueSize>256</queueSize> @@ -190,28 +191,29 @@ <logger name="org.springframework" level="WARN" /> <logger name="org.springframework.security.authentication.dao.DaoAuthenticationProvider" - level="DEBUG" /> + level="${LOG_LEVEL:-DEBUG}" /> <!-- Camunda related loggers --> - <logger name="org.camunda.bpm.engine.jobexecutor.level" level="DEBUG" /> + <logger name="org.camunda.bpm.engine.jobexecutor.level" level="${LOG_LEVEL:-DEBUG}" /> <logger name="org.camunda.bpm.engine.impl.persistence.entity.JobEntity.level" - level="DEBUG" /> + level="${LOG_LEVEL:-DEBUG}" /> - <logger name="org.flywaydb" level="DEBUG"/> - <logger name="org.apache.wire" level="DEBUG" /> - <logger name="org.onap" level="DEBUG" /> - <logger name="org.apache.cxf.interceptor" level="DEBUG" /> - <logger name="com.woorea.openstack.connector" level="DEBUG" /> + <logger name="org.flywaydb" level="${LOG_LEVEL:-DEBUG}"/> + <logger name="org.apache.wire" level="${LOG_LEVEL:-DEBUG}" /> + <logger name="org.onap" level="${LOG_LEVEL:-DEBUG}" /> + <logger name="org.apache.cxf.interceptor" level="${LOG_LEVEL:-DEBUG}" /> + <logger name="com.woorea.openstack.connector" level="${LOG_LEVEL:-DEBUG}" /> <!-- AAF Logs go here--> <logger name="org.apache.catalina.core.ContainerBase" level="INFO" additivity="false"> <appender-ref ref="asyncCadi" /> </logger> - - <logger name="org.reflections.Reflections" level="ERROR" additivity="false"> - <appender-ref ref="asyncCadi" /> - </logger> + + <!-- Jersey Openstack Connector Logs Go Here for Openstack4J --> + <logger name="os" level="${LOG_LEVEL:-DEBUG}" /> + + <logger name="org.reflections" level="ERROR" additivity="false" /> <logger name="AUDIT" level="INFO" additivity="false"> <appender-ref ref="asyncAudit" /> diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java index 4e3d8736c2..a522129c31 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/AAIDataRetrieval.java @@ -1,19 +1,29 @@ package org.onap.so.apihandlerinfra.infra.rest; +import java.util.List; import java.util.Optional; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.L3Network; +import org.onap.aai.domain.yang.LInterface; import org.onap.aai.domain.yang.Service; import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aai.domain.yang.Tenant; import org.onap.aai.domain.yang.VfModule; import org.onap.aai.domain.yang.VolumeGroup; import org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound; +import org.onap.so.client.aai.AAIDSLQueryClient; import org.onap.so.client.aai.AAIObjectPlurals; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.aai.AAIResourcesClient; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.uri.AAIUriFactory; +import org.onap.so.client.graphinventory.entities.DSLQuery; +import org.onap.so.client.graphinventory.entities.DSLQueryBuilder; +import org.onap.so.client.graphinventory.entities.DSLStartNode; +import org.onap.so.client.graphinventory.entities.Node; +import org.onap.so.client.graphinventory.entities.Start; +import org.onap.so.client.graphinventory.entities.TraversalBuilder; +import org.onap.so.client.graphinventory.entities.__; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -25,6 +35,8 @@ public class AAIDataRetrieval { private AAIResourcesClient aaiResourcesClient; + private AAIDSLQueryClient aaiDslQueryClient; + private static final Logger logger = LoggerFactory.getLogger(AAIDataRetrieval.class); public ServiceInstance getServiceInstance(String serviceInstanceId) { @@ -129,6 +141,22 @@ public class AAIDataRetrieval { }); } + public List<LInterface> getLinterfacesOfVnf(String vnfId) { + DSLStartNode startNode = new DSLStartNode(AAIObjectType.GENERIC_VNF, __.key("generic-vnf-id", vnfId)); + DSLQueryBuilder<Start, Node> builder = TraversalBuilder.fragment(startNode) + .to(__.node(AAIObjectType.VSERVER).to(__.node(AAIObjectType.L_INTERFACE).output())); + List<LInterface> linterfaces = + getAAIDSLQueryClient().querySingleResource(new DSLQuery(builder.build()), LInterface.class); + return linterfaces; + } + + private AAIDSLQueryClient getAAIDSLQueryClient() { + if (aaiDslQueryClient == null) { + aaiDslQueryClient = new AAIDSLQueryClient(); + } + return aaiDslQueryClient; + } + protected AAIResourcesClient getAaiResourcesClient() { if (aaiResourcesClient == null) { aaiResourcesClient = new AAIResourcesClient(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java index 0c7ba65cf4..61f757ba64 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/validators/ServiceInstanceDeleteValidator.java @@ -6,11 +6,10 @@ import java.util.regex.Pattern; import org.onap.so.apihandlerinfra.Action; import org.onap.so.apihandlerinfra.Actions; import org.onap.so.apihandlerinfra.infra.rest.AAIDataRetrieval; -import org.onap.so.listener.Skip; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import org.springframework.beans.factory.annotation.Autowired; -@Skip + public class ServiceInstanceDeleteValidator implements RequestValidator { @Autowired @@ -49,7 +49,7 @@ <sonar.cpd.exclusions>**/*</sonar.cpd.exclusions> <jacoco.version>0.8.5</jacoco.version> <org.apache.maven.user-settings /> - <openstack.version>1.5.2-SNAPSHOT</openstack.version> + <openstack.version>1.6.1-SNAPSHOT</openstack.version> <maven.build.timestamp.format>yyyyMMdd'T'HHmm</maven.build.timestamp.format> <originalClassifier>original</originalClassifier> <docker.skip>true</docker.skip> |