From 62cd6aaaf74aa91ee0037c0e155c8e7284f07567 Mon Sep 17 00:00:00 2001 From: Arthur Martella Date: Fri, 8 Sep 2017 13:27:46 -0400 Subject: 1710 Rebase - Second Attempt This commit rebases changes from openecomp-mso/internal-staging-1710 up to and including this codecloud commit: 54483fc6606ddb1591a2e9da61bff8712325f924 Wed Sep 6 18:12:56 2017 -0400 Rebasing was done on a branch on top of this commit in so/master in ONAP: 93fbdfbe46104f8859d4754040f979cb7997c157 Thu Sep 7 16:42:59 2017 +0000 Change-Id: I4ad9abf40da32bf5bdca43e868b8fa2dbcd9dc59 Issue-id: SO-107 Signed-off-by: Arthur Martella --- bpmn/MSOCommonBPMN/pom.xml | 437 +- .../mso/bpmn/common/scripts/AaiUtil.groovy | 197 +- .../scripts/AbstractServiceTaskProcessor.groovy | 65 +- .../common/scripts/AllottedResourceUtils.groovy | 31 +- .../mso/bpmn/common/scripts/CatalogDbUtils.groovy | 578 +- .../bpmn/common/scripts/CompleteMsoProcess.groovy | 141 +- .../bpmn/common/scripts/CreateAAIVfModule.groovy | 2 +- .../bpmn/common/scripts/DecomposeService.groovy | 160 + .../mso/bpmn/common/scripts/FalloutHandler.groovy | 16 +- .../bpmn/common/scripts/GenericGetService.groovy | 4 - .../mso/bpmn/common/scripts/ManualHandling.groovy | 253 + .../mso/bpmn/common/scripts/MsoUtils.groovy | 2 + .../mso/bpmn/common/scripts/NetworkUtils.groovy | 159 +- .../mso/bpmn/common/scripts/RainyDayHandler.groovy | 169 + .../mso/bpmn/common/scripts/SDNCAdapter.groovy | 9 +- .../bpmn/common/scripts/SDNCAdapterUtils.groovy | 92 +- .../mso/bpmn/common/scripts/VfModuleBase.groovy | 313 + .../mso/bpmn/common/scripts/VidUtils.groovy | 78 +- .../bpmn/common/scripts/VnfAdapterRestV1.groovy | 1 + .../workflow/service/AbstractCallbackService.java | 12 +- .../service/WorkflowAsyncCommonResource.java | 32 - .../workflow/service/WorkflowAsyncResource.java | 68 +- .../common/workflow/service/WorkflowContext.java | 2 +- .../common/workflow/service/WorkflowResource.java | 6 +- .../service/WorkflowResourceApplication.java | 2 +- .../aai/AAIClientResponseExceptionMapper.java | 71 + .../client/aai/AAICommonObjectMapperProvider.java | 49 + .../client/aai/AAIQueryObjectMapperProvider.java | 47 + .../aai/AAIResourcesObjectMapperProvider.java | 38 + .../openecomp/mso/client/aai/AAIRestClient.java | 24 + .../mso/client/aai/AAIRestClientImpl.java | 167 + .../org/openecomp/mso/client/aai/AAIUpdator.java | 11 + .../openecomp/mso/client/aai/AAIUpdatorImpl.java | 29 + .../org/openecomp/mso/client/aai/AAIValidator.java | 12 + .../openecomp/mso/client/aai/AAIValidatorImpl.java | 51 + .../mso/client/aai/entities/AAIEntity.java | 5 + .../mso/client/aai/entities/AAIError.java | 27 + .../mso/client/aai/entities/CustomQuery.java | 48 + .../mso/client/aai/entities/RequestError.java | 27 + .../openecomp/mso/client/aai/entities/Results.java | 33 + .../mso/client/aai/entities/ServiceException.java | 54 + .../client/appc/ApplicationControllerCallback.java | 19 + .../client/appc/ApplicationControllerClient.java | 147 + .../client/appc/ApplicationControllerSupport.java | 226 + .../org/openecomp/mso/client/dmaap/Consumer.java | 34 + .../openecomp/mso/client/dmaap/DmaapConsumer.java | 40 + .../openecomp/mso/client/dmaap/DmaapPublisher.java | 30 + .../mso/client/exceptions/SDNOException.java | 19 + .../client/policy/CommonObjectMapperProvider.java | 31 + .../mso/client/policy/DecisionAttributes.java | 74 + .../openecomp/mso/client/policy/LoggingFilter.java | 109 + .../mso/client/policy/PolicyDecision.java | 38 + .../mso/client/policy/PolicyDecisionRequest.java | 38 + .../mso/client/policy/PolicyRestClient.java | 69 + .../openecomp/mso/client/policy/RestClient.java | 76 + .../java/org/openecomp/mso/client/sdno/Body.java | 58 + .../java/org/openecomp/mso/client/sdno/Input.java | 58 + .../mso/client/sdno/RequestHealthDiagnostic.java | 166 + .../org/openecomp/mso/client/sdno/ResultInfo.java | 96 + .../java/org/openecomp/mso/client/sdno/SDNO.java | 94 + .../openecomp/mso/client/sdno/SDNOValidator.java | 9 + .../mso/client/sdno/SDNOValidatorImpl.java | 133 + .../org/openecomp/mso/jsonpath/JsonPathUtil.java | 39 + .../src/main/resources/processengine.properties | 20 - .../MSOCommonBPMN/src/main/resources/processes.xml | 81 - .../subprocess/BuildingBlock/DecomposeService.bpmn | 142 + .../subprocess/BuildingBlock/ManualHandling.bpmn | 135 + .../subprocess/BuildingBlock/RainyDayHandler.bpmn | 186 + .../resources/subprocess/CompleteMsoProcess.bpmn | 560 +- .../main/resources/subprocess/FalloutHandler.bpmn | 6 +- .../main/resources/subprocess/SDNCAdapterV1.bpmn | 131 +- bpmn/MSOCommonBPMN/src/main/resources/xjb/AAI.xjb | 14 + .../src/main/resources/xsd/MSOWorkflowSchemaV1.xsd | 137 + .../src/main/resources/xsd/ManualTasks.xsd | 49 + .../resources/xsd/MsoServiceRequestTypesV1.xsd | 106 + .../src/main/resources/xsd/aai_schema_v10.xsd | 6547 ++++++++++++++++++ .../src/main/resources/xsd/aai_schema_v11.xsd | 6934 ++++++++++++++++++++ .../src/main/webapp/WEB-INF/applicationContext.xml | 14 + .../webapp/WEB-INF/jboss-deployment-structure.xml | 7 + bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml | 7 + .../common/scripts/CompleteMsoProcessTest.groovy | 50 +- .../bpmn/common/scripts/FalloutHandlerTest.groovy | 1 + .../common/scripts/GenericPutServiceTest.groovy | 214 + .../bpmn/common/scripts/NetworkUtilsTest.groovy | 97 + .../mso/bpmn/common/scripts/VidUtilsTest.groovy | 106 +- .../org/openecomp/mso/bpmn/common/BPMNUtil.java | 4 +- .../mso/bpmn/common/DecomposeServiceTest.java | 95 + .../mso/bpmn/common/ManualHandlingTest.java | 122 + .../mso/bpmn/common/RainyDayHandlerTest.java | 85 + .../mso/bpmn/common/SDNCAdapterV1Test.java | 70 +- .../mso/bpmn/common/WorkflowAsyncResourceTest.java | 4 +- .../openecomp/mso/bpmn/common/WorkflowTest.java | 188 +- .../openecomp/mso/client/aai/AAIPServerTest.java | 45 + .../openecomp/mso/client/aai/AAIValidatorTest.java | 80 + .../org/openecomp/mso/client/aai/EntitiesTest.java | 21 + .../appc/ApplicationControllerClientTest.java | 78 + .../mso/client/policy/PolicyDecisionTest.java | 50 + .../__files/Policy/policyAbortResponse.json | 1 + .../__files/Policy/policySkipResponse.json | 1 + .../src/test/resources/__files/aai/pserver.json | 14 + .../__files/getCatalogServiceResourcesData.json | 57 + .../src/test/resources/mso.bpmn.urn.properties | 26 +- 102 files changed, 20237 insertions(+), 1373 deletions(-) create mode 100644 bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy create mode 100644 bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/ManualHandling.groovy create mode 100644 bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/RainyDayHandler.groovy delete mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIClientResponseExceptionMapper.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAICommonObjectMapperProvider.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIQueryObjectMapperProvider.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIResourcesObjectMapperProvider.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdator.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdatorImpl.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidator.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidatorImpl.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIEntity.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIError.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/CustomQuery.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/RequestError.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/ServiceException.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerCallback.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerSupport.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/exceptions/SDNOException.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/CommonObjectMapperProvider.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/DecisionAttributes.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecision.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecisionRequest.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java create mode 100644 bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/jsonpath/JsonPathUtil.java delete mode 100644 bpmn/MSOCommonBPMN/src/main/resources/processengine.properties delete mode 100644 bpmn/MSOCommonBPMN/src/main/resources/processes.xml create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/DecomposeService.bpmn create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/ManualHandling.bpmn create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/RainyDayHandler.bpmn create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/xjb/AAI.xjb create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/xsd/ManualTasks.xsd create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v10.xsd create mode 100644 bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v11.xsd create mode 100644 bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml create mode 100644 bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy create mode 100644 bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java create mode 100644 bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policyAbortResponse.json create mode 100644 bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policySkipResponse.json create mode 100644 bpmn/MSOCommonBPMN/src/test/resources/__files/aai/pserver.json create mode 100644 bpmn/MSOCommonBPMN/src/test/resources/__files/getCatalogServiceResourcesData.json (limited to 'bpmn/MSOCommonBPMN') diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml index 3452fe3fdd..24c881d566 100644 --- a/bpmn/MSOCommonBPMN/pom.xml +++ b/bpmn/MSOCommonBPMN/pom.xml @@ -1,34 +1,47 @@ - + 4.0.0 org.openecomp.so - bpmn - 1.1.0-SNAPSHOT - - MSOCommonBPMN - MSOCommonBPMN - war + bpmn + 1.1.0-SNAPSHOT + + MSOCommonBPMN + MSOCommonBPMN + war + + + 7.6.0 + 3.1.2.RELEASE + 3.1 + 2.0.1 + 4.1.4.RELEASE + 1.1.1 + 1.8 + 1.8 + + - - org.apache.maven.plugins - maven-compiler-plugin - - - test-compile - compile - - testCompile - - - false - - - - + + org.apache.maven.plugins + maven-compiler-plugin + + + test-compile + compile + + testCompile + + + false + + + + org.apache.maven.plugins @@ -36,58 +49,58 @@ 2.6 - + default-jar package jar - + org/openecomp/mso/bpmn/common/MSOCommonApplication.class - + - - - test-jar - - - true - false - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 3.0.0 - - - - attach-artifact - - package - - - - ${project.build.directory}/${project.artifactId}-${project.version}.jar - jar - - - - - - + + + test-jar + + + true + false + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + + attach-artifact + + package + + + + ${project.build.directory}/${project.artifactId}-${project.version}.jar + jar + + + + + + org.apache.maven.plugins maven-war-plugin 2.3 - false + false @@ -96,18 +109,18 @@ 2.5.2 - org.apache.maven.plugins - maven-eclipse-plugin - 2.8 - - - org.eclipse.jdt.groovy.core.groovyNature - - - **/*.groovy - - - + org.apache.maven.plugins + maven-eclipse-plugin + 2.8 + + + org.eclipse.jdt.groovy.core.groovyNature + + + **/*.groovy + + + maven-antrun-plugin @@ -153,10 +166,54 @@ + + org.codehaus.mojo + jaxb2-maven-plugin + 2.3 + + + xjc + + xjc + + + + + true + + -Xannotate + -Xcommons-lang + + + src/main/resources/xsd + + + src/main/resources/xjb + + ${project.build.directory}/generated-sources + + + + org.jvnet.jaxb2_commons + jaxb2-basics-annotate + 0.6.4 + + + org.jvnet.jaxb2_commons + jaxb2-commons-lang + 2.3 + + + com.sun.codemodel + codemodel + 2.6 + + + - org.eclipse.m2e @@ -188,6 +245,8 @@ + + @@ -206,20 +265,18 @@ - - org.camunda.bpm camunda-engine-cdi - org.camunda.bpm.extension camunda-bpm-assert - 1.2 test @@ -228,15 +285,8 @@ 1.10.19 test - - - org.camunda.bpm.workbench - camunda-workbench-dist-embeddable - 1.0.0-alpha8 - test - - - org.camunda.spin @@ -263,10 +313,10 @@ - org.jboss.resteasy - resteasy-client - 3.0.19.Final - provided + org.jboss.resteasy + resteasy-client + 3.0.19.Final + provided org.apache.httpcomponents @@ -313,33 +363,34 @@ javax.ws.rs-api 2.0 - - - org.springframework - spring-web - 4.3.2.RELEASE - - - org.openecomp.so - MSOMockServer - ${project.version} - classes - test - - - org.openecomp.so - MSORESTClient - ${project.version} - + + + org.openecomp.so + MSOMockServer + ${project.version} + classes + test + + + org.openecomp.so + MSORESTClient + ${project.version} + - - javax.servlet - javax.servlet-api - 3.0.1 - provided - + + javax.servlet + javax.servlet-api + 3.0.1 + provided + - + + org.springframework + spring-test + 4.3.2.RELEASE + + + com.github.tomakehurst wiremock 1.56 @@ -388,5 +439,161 @@ + + org.camunda.bpm + camunda-engine-spring + + + org.springframework + spring-beans + + + com.fasterxml.jackson.core + jackson-annotations + 2.8.7 + + + com.fasterxml.jackson.core + jackson-core + 2.8.7 + + + com.fasterxml.jackson.module + jackson-module-jaxb-annotations + 2.4.0 + + + org.aspectj + aspectjrt + 1.6.12 + + + commons-httpclient + commons-httpclient + ${httpclient.version} + + + org.openecomp.appc.client + client-kit + 1.1.0 + + + org.openecomp.appc.client + client-lib + 1.1.0 + + + + org.onap.aai.aai-common + aai-schema + 1.1.0-SNAPSHOT + + + + + com.fasterxml.jackson.core + jackson-databind + 2.8.7 + + + org.mockito + mockito-all + 1.10.19 + + + commons-lang + commons-lang + 2.6 + + + com.openpojo + openpojo + 0.8.6 + + + com.jayway.jsonpath + json-path + 2.2.0 + + + org.springframework + spring-web + 4.3.2.RELEASE + + + org.springframework + spring-test + ${spring.version} + + + junit + junit + 4.12 + + + commons-httpclient + commons-httpclient + ${httpclient.version} + + + javax.ws.rs + javax.ws.rs-api + ${jax.ws.rs} + + + + org.openecomp.appc.client + client-kit + 1.1.0 + + + org.openecomp.appc.client + client-lib + 1.1.0 + + + + com.fasterxml.jackson.core + jackson-databind + 2.8.7 + + + com.fasterxml.jackson.core + jackson-annotations + 2.8.7 + + + com.fasterxml.jackson.module + jackson-module-jaxb-annotations + 2.4.0 + + + org.aspectj + aspectjrt + 1.6.12 + + + org.mockito + mockito-all + 1.10.19 + + + com.att.nsa + dmaapClient + 0.2.12 + + + + org.camunda.bpm.workbench + camunda-workbench-dist-embeddable + 1.0.0-alpha8 + test + + + org.jboss.resteasy + resteasy-jackson2-provider + 3.0.11.Final + + diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtil.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtil.groovy index af650b49a4..82d58cfe7a 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtil.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AaiUtil.groovy @@ -7,9 +7,9 @@ * 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. @@ -33,7 +33,7 @@ class AaiUtil { public static final String DEFAULT_VERSION_KEY = 'URN_mso_workflow_global_default_aai_version' private String aaiNamespace = null; - + private AbstractServiceTaskProcessor taskProcessor public AaiUtil(AbstractServiceTaskProcessor taskProcessor) { @@ -186,7 +186,7 @@ class AaiUtil { //set namespace setNamespace(execution) - + // Check for flow+resource specific first def key = "URN_mso_workflow_${processKey}_aai_${resourceName}_uri" def uri = execution.getVariable(key) @@ -215,7 +215,7 @@ class AaiUtil { (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 9999, 'Internal Error: AAI URI entry for ' + key + ' not defined in the MSO URN properties file') } } - + /** * This method can be used for getting the building namespace out of uri. * NOTE: A getUri() method needs to be invoked first. @@ -226,7 +226,7 @@ class AaiUtil { * * @return namespace */ - + public String getNamespaceFromUri(String uri) { if (aaiNamespace == null) { throw new Exception('Internal Error: AAI Namespace has not been set yet. A getUri() method needs to be invoked first.') @@ -260,7 +260,7 @@ class AaiUtil { return namespace } } - + /** * This is used to extract the version from uri. * @@ -280,7 +280,7 @@ class AaiUtil { } return savedVersion } - + /** * This reusable method can be used for making AAI Get Calls. The url should @@ -291,32 +291,33 @@ class AaiUtil { * @param url * * @return APIResponse + * */ public APIResponse executeAAIGetCall(Execution execution, String url){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug(" ======== STARTED Execute AAI Get Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ String uuid = utils.getRequestID() taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled) taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled) - + String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_aai_auth"),execution.getVariable("URN_mso_msoKey")) RESTConfig config = new RESTConfig(url); RESTClient client = new RESTClient(config).addHeader("X-FromAppId", "MSO").addHeader("X-TransactionId", uuid).addHeader("Accept","application/xml"); - + if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - - APIResponse apiResponse = client.get() - return apiResponse + apiResponse = client.get() + taskProcessor.logDebug( "======== COMPLETED Execute AAI Get Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.logDebug("Exception occured while executing AAI Get Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== COMPLETED Execute AAI Get Process ======== ", isDebugEnabled) + return apiResponse } @@ -330,15 +331,17 @@ class AaiUtil { * @param payload * * @return APIResponse + * */ public APIResponse executeAAIPutCall(Execution execution, String url, String payload){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug( " ======== Started Execute AAI Put Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ String uuid = utils.getRequestID() taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled) taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled) - + String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_aai_auth"),execution.getVariable("URN_mso_msoKey")) RESTConfig config = new RESTConfig(url); @@ -346,14 +349,14 @@ class AaiUtil { if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - APIResponse apiResponse = client.httpPut(payload) + apiResponse = client.httpPut(payload) - return apiResponse + taskProcessor.logDebug( "======== Completed Execute AAI Put Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Put Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== Completed Execute AAI Put Process ======== ", isDebugEnabled) + return apiResponse } /** @@ -366,10 +369,12 @@ class AaiUtil { * @param payload * * @return APIResponse + * */ public APIResponse executeAAIPatchCall(Execution execution, String url, String payload){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug( " ======== Started Execute AAI Patch Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ String uuid = utils.getRequestID() taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled) @@ -377,20 +382,20 @@ class AaiUtil { taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled) String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_aai_auth"),execution.getVariable("URN_mso_msoKey")) - + RESTConfig config = new RESTConfig(url); RESTClient client = new RESTClient(config).addHeader("X-FromAppId", "MSO").addHeader("X-TransactionId", uuid).addHeader("Content-Type", "application/merge-patch+json").addHeader("Accept","application/json"); if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - APIResponse apiResponse = client.httpPatch(payload) + apiResponse = client.httpPatch(payload) - return apiResponse + taskProcessor.logDebug( "======== Completed Execute AAI Patch Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Patch Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== Completed Execute AAI Patch Process ======== ", isDebugEnabled) + return apiResponse } @@ -403,10 +408,12 @@ class AaiUtil { * @param url * * @return APIResponse + * */ public APIResponse executeAAIDeleteCall(Execution execution, String url){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug( " ======== Started Execute AAI Delete Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ String uuid = utils.getRequestID() taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled) @@ -419,15 +426,14 @@ class AaiUtil { if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - APIResponse apiResponse = client.delete() - - return apiResponse + apiResponse = client.delete() + taskProcessor.logDebug( "======== Completed Execute AAI Delete Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Delete Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== Completed Execute AAI Delete Process ======== ", isDebugEnabled) + return apiResponse } /** @@ -440,10 +446,12 @@ class AaiUtil { * @param payload * * @return APIResponse + * */ public APIResponse executeAAIDeleteCall(Execution execution, String url, String payload, String authHeader){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug( " ======== Started Execute AAI Delete Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ String uuid = utils.getRequestID() taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled) @@ -456,16 +464,14 @@ class AaiUtil { if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - - APIResponse apiResponse = client.httpDelete(payload) - - return apiResponse + apiResponse = client.httpDelete(payload) + taskProcessor.logDebug( "======== Completed Execute AAI Delete Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Delete Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== Completed Execute AAI Delete Process ======== ", isDebugEnabled) + return apiResponse } /** @@ -478,10 +484,12 @@ class AaiUtil { * @param payload * * @return APIResponse + * */ public APIResponse executeAAIPostCall(Execution execution, String url, String payload){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug( " ======== Started Execute AAI Post Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ String uuid = utils.getRequestID() taskProcessor.logDebug( "Generated uuid is: " + uuid, isDebugEnabled) @@ -490,19 +498,18 @@ class AaiUtil { String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_aai_auth"),execution.getVariable("URN_mso_msoKey")) RESTConfig config = new RESTConfig(url); RESTClient client = new RESTClient(config).addHeader("X-FromAppId", "MSO").addHeader("X-TransactionId", uuid).addHeader("Accept","application/xml"); - + if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - APIResponse apiResponse = client.httpPost(payload) - - return apiResponse + apiResponse = client.httpPost(payload) + taskProcessor.logDebug( "======== Completed Execute AAI Post Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Post Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== Completed Execute AAI Post Process ======== ", isDebugEnabled) + return apiResponse } /** @@ -518,35 +525,33 @@ class AaiUtil { * @param headerValue - the header's value, i.e. addHeader(headerName, headerValue) * * @return APIResponse + * */ public APIResponse executeAAIPostCall(Execution execution, String url, String payload, String authenticationHeaderValue, String headerName, String headerValue){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") taskProcessor.logDebug( " ======== Started Execute AAI Post Process ======== ", isDebugEnabled) + APIResponse apiResponse = null try{ taskProcessor.logDebug( "URL to be used is: " + url, isDebugEnabled) String basicAuthCred = utils.getBasicAuth(execution.getVariable("URN_aai_auth"),execution.getVariable("URN_mso_msoKey")) - + RESTConfig config = new RESTConfig(url); RESTClient client = new RESTClient(config).addAuthorizationHeader(authenticationHeaderValue).addHeader(headerName, headerValue) if (basicAuthCred != null && !"".equals(basicAuthCred)) { client.addAuthorizationHeader(basicAuthCred) } - APIResponse apiResponse = client.httpPost(payload) - - return apiResponse + apiResponse = client.httpPost(payload) + taskProcessor.logDebug( "======== Completed Execute AAI Post Process ======== ", isDebugEnabled) }catch(Exception e){ taskProcessor.utils.log("ERROR", "Exception occured while executing AAI Post Call. Exception is: \n" + e, isDebugEnabled) - return e + throw new BpmnError("MSOWorkflowException") } - taskProcessor.logDebug( "======== Completed Execute AAI Post Process ======== ", isDebugEnabled) + return apiResponse } - - - /* Utility to get the Cloud Region from AAI * Returns String cloud region id, (ie, cloud-region-id) * @param execution @@ -554,60 +559,50 @@ class AaiUtil { * @param backend - "PO" - real region, or "SDNC" - v2.5 (fake region). */ - //TODO: We should refactor this method to return WorkflowException instead of Error. Also to throw MSOWorkflowException which the calling flow will then catch. - public String getAAICloudReqion(Execution execution, String url, String backend, inputCloudRegion){ def isDebugEnabled = execution.getVariable("isDebugLogEnabled") - - try { - APIResponse apiResponse = executeAAIGetCall(execution, url) - String returnCode = apiResponse.getStatusCode() - String aaiResponseAsString = apiResponse.getResponseBodyAsString() - taskProcessor.utils.log("DEBUG", "Call AAI Cloud Region Return code: " + returnCode, isDebugEnabled) - execution.setVariable(execution.getVariable("prefix")+"queryCloudRegionReturnCode", returnCode) - //taskProcessor.utils.log("DEBUG", "Call AAI Cloud Region Response: " + aaiResponseAsString, isDebugEnabled) - //execution.setVariable(execution.getVariable("prefix")+"queryCloudRegionResponse", aaiResponseAsString) - String regionId = "" - if (returnCode == "200") { - taskProcessor.utils.log("DEBUG", "Call AAI Cloud Region is Successful.", isDebugEnabled) - try { - String regionVersion = taskProcessor.utils.getNodeText(aaiResponseAsString, "cloud-region-version") - taskProcessor.utils.log("DEBUG", "Cloud Region Version from AAI for " + backend + " is: " + regionVersion, isDebugEnabled) - if (backend == "PO") { - regionId = taskProcessor.utils.getNodeText(aaiResponseAsString, "cloud-region-id") - } else { // backend not "PO" - if (regionVersion == "2.5" ) { - regionId = "AAIAIC25" - } else { - regionId = taskProcessor.utils.getNodeText(aaiResponseAsString, "cloud-region-id") - } - } - - taskProcessor.utils.log("DEBUG", "Cloud Region Id from AAI " + backend + " is: " + regionId, isDebugEnabled) - return regionId - - } catch (Exception e) { - taskProcessor.utils.log("ERROR", "Exception occured while getting the Cloud Reqion. Exception is: \n" + e, isDebugEnabled) - return "ERROR" - } - } else { // not 200 - if (returnCode == "404") { - if (backend == "PO") { - regionId = inputCloudRegion - } else { // backend not "PO" - regionId = "AAIAIC25" - } - taskProcessor.utils.log("DEBUG", "Cloud Region value for code='404' of " + backend + " is: " + regionId, isDebugEnabled) - return regionId - } else { - taskProcessor.utils.log("ERROR", "Call AAI Cloud Region is NOT Successful.", isDebugEnabled) - return "ERROR" - } - } + String regionId = "" + try{ + APIResponse apiResponse = executeAAIGetCall(execution, url) + String returnCode = apiResponse.getStatusCode() + String aaiResponseAsString = apiResponse.getResponseBodyAsString() + taskProcessor.utils.log("DEBUG", "Call AAI Cloud Region Return code: " + returnCode, isDebugEnabled) + execution.setVariable(execution.getVariable("prefix")+"queryCloudRegionReturnCode", returnCode) + + if(returnCode == "200"){ + taskProcessor.utils.log("DEBUG", "Call AAI Cloud Region is Successful.", isDebugEnabled) + + String regionVersion = taskProcessor.utils.getNodeText1(aaiResponseAsString, "cloud-region-version") + taskProcessor.utils.log("DEBUG", "Cloud Region Version from AAI for " + backend + " is: " + regionVersion, isDebugEnabled) + if (backend == "PO") { + regionId = taskProcessor.utils.getNodeText1(aaiResponseAsString, "cloud-region-id") + } else { // backend not "PO" + if (regionVersion == "2.5" ) { + regionId = "AAIAIC25" + } else { + regionId = taskProcessor.utils.getNodeText1(aaiResponseAsString, "cloud-region-id") + } + } + if(regionId == null){ + throw new BpmnError("MSOWorkflowException") + } + taskProcessor.utils.log("DEBUG", "Cloud Region Id from AAI " + backend + " is: " + regionId, isDebugEnabled) + }else if (returnCode == "404"){ // not 200 + if (backend == "PO") { + regionId = inputCloudRegion + }else{ // backend not "PO" + regionId = "AAIAIC25" + } + taskProcessor.utils.log("DEBUG", "Cloud Region value for code='404' of " + backend + " is: " + regionId, isDebugEnabled) + }else{ + taskProcessor.utils.log("ERROR", "Call AAI Cloud Region is NOT Successful.", isDebugEnabled) + throw new BpmnError("MSOWorkflowException") + } }catch(Exception e) { - taskProcessor.utils.log("ERROR", "Exception occured while getting the Cloud Reqion. Exception is: \n" + e, isDebugEnabled) - return "ERROR" + taskProcessor.utils.log("ERROR", "Exception occured while getting the Cloud Reqion. Exception is: \n" + e, isDebugEnabled) + throw new BpmnError("MSOWorkflowException") } + return regionId } /* returns xml Node with service-type of searchValue */ diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy index e86f77c890..4bfeabfeaa 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AbstractServiceTaskProcessor.groovy @@ -385,7 +385,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess /** * Returns the process definition key (i.e. the process name) of the * current process. - * + * * @param execution the execution */ public String getProcessKey(Execution execution) { @@ -481,6 +481,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess def nodeText = utils.getNodeText1(xml, elementName) return (nodeText == null) ? defaultValue : nodeText } + /** * Get the text for the specified element from the specified xml. If * the element does not exist, return an empty string. @@ -579,7 +580,6 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess logDebug('Outgoing SuccessIndicator is: ' + execution.getVariable(prefix+'SuccessIndicator') + '', isDebugLogEnabled) } - /** * Sends a Error Sync Response * @@ -597,17 +597,6 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess } } - /** - * Create a WorkflowException - uses ExceptionUtil to build a WorkflowException - * @param execution - * @param errorCode - * @param errorMessage - * @param isDebugEnabled - */ - public void buildWorkflowException(Execution execution, int errorCode, String errorMessage, boolean isDebugEnabled) { - (new ExceptionUtil()).buildWorkflowException(execution, errorCode, errorMessage) - } - /** * Executes a named groovy script method in the current object */ @@ -721,7 +710,7 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess '/' + UriUtils.encodePathSegment(messageType, 'UTF-8') + '/' + UriUtils.encodePathSegment(correlator, 'UTF-8') } - + /** * * Constructs a workflow message callback URL for the specified message type and correlator. @@ -747,4 +736,52 @@ public abstract class AbstractServiceTaskProcessor implements ServiceTaskProcess '/' + UriUtils.encodePathSegment(messageType, 'UTF-8') + '/' + UriUtils.encodePathSegment(correlator, 'UTF-8') } + + public void setRollbackEnabled(Execution execution, isDebugLogEnabled) { + + // Rollback settings + def prefix = execution.getVariable('prefix') + def disableRollback = execution.getVariable("disableRollback") + def defaultRollback = execution.getVariable("URN_mso_rollback").toBoolean() + + logDebug('disableRollback: ' + disableRollback, isDebugLogEnabled) + logDebug('defaultRollback: ' + defaultRollback, isDebugLogEnabled) + + def rollbackEnabled + + if(disableRollback == null || disableRollback == '' ) { + // get from default urn settings for mso_rollback + disableRollback = !defaultRollback + rollbackEnabled = defaultRollback + logDebug('disableRollback is null or empty!', isDebugLogEnabled) + } + else { + if(disableRollback == true) { + rollbackEnabled = false + } + else if(disableRollback == false){ + rollbackEnabled = true + } + else { + rollbackEnabled = defaultRollback + } + } + + execution.setVariable(prefix+"backoutOnFailure", rollbackEnabled) + logDebug('rollbackEnabled (aka backoutOnFailure): ' + rollbackEnabled, isDebugLogEnabled) + } + + public void setBasicDBAuthHeader(Execution execution, isDebugLogEnabled) { + try { + String basicAuthValueDB = execution.getVariable("URN_mso_adapters_db_auth") + utils.log("DEBUG", " Obtained BasicAuth userid password for Catalog DB adapter: " + basicAuthValueDB, isDebugLogEnabled) + + def encodedString = utils.getBasicAuth(basicAuthValueDB, execution.getVariable("URN_mso_msoKey")) + execution.setVariable("BasicAuthHeaderValueDB",encodedString) + } catch (IOException ex) { + String dataErrorMessage = " Unable to encode Catalog DB user/password string - " + ex.getMessage() + utils.log("DEBUG", dataErrorMessage, isDebugLogEnabled) + (new ExceptionUtil()).buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) + } + } } \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AllottedResourceUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AllottedResourceUtils.groovy index 540fe036fc..8e2403ceea 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AllottedResourceUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/AllottedResourceUtils.groovy @@ -6,8 +6,17 @@ import org.camunda.bpm.engine.runtime.Execution; import org.openecomp.mso.bpmn.core.WorkflowException import org.openecomp.mso.rest.APIResponse; + +import org.apache.commons.lang3.* +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.runtime.Execution; + +import groovy.util.XmlParser +import groovy.util.Node +import static org.apache.commons.lang3.StringUtils.*; + class AllottedResourceUtils { - + private AbstractServiceTaskProcessor taskProcessor ExceptionUtil exceptionUtil = new ExceptionUtil() MsoUtils utils; @@ -84,6 +93,18 @@ class AllottedResourceUtils { utils.log("DEBUG", " ***** Exit GetARbyId ***** AR:" + ar, isDebugEnabled) return ar; } + + public String getPSIFmARLink(Execution execution, String arLink) + { + def isDebugEnabled=execution.getVariable("isDebugLogEnabled") + // Path: /aai/{version}/business/customers/customer/{cust}/service-subscriptions/service-subscription/{subs}/service-instances/service-instance/{psiid}/allotted-resources/allotted-resource/{arid} + utils.log("DEBUG", " ***** getPSIFmARLink ***** path:" + arLink, isDebugEnabled) + String[] split = arLink.split("/service-instance/") + String[] splitB = split[1].split("/allotted-resources/") + String siId = splitB[0] + utils.log("DEBUG", " ***** Exit getARLinkbyId ***** parentServiceInstanceId:" + siId , isDebugEnabled) + return siId + } // get Allotted Resource Link by AllottedResourceId using Nodes Query // used on Delete - called from getARbyId @@ -222,10 +243,10 @@ class AllottedResourceUtils { try{ String updateReq = """ - { - "orchestration-status": "Created"" - } - """ + { + "orchestration-status": "${status}" + } + """ utils.log("DEBUG", 'AAI AR URI: ' + aaiARPath, isDebugEnabled) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy index 488535024b..9d67f0a700 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CatalogDbUtils.groovy @@ -33,6 +33,8 @@ import groovy.json.JsonSlurper import groovy.util.slurpersupport.GPathResult import groovy.xml.QName; +import org.camunda.bpm.engine.runtime.Execution + import org.openecomp.mso.logger.MsoLogger; import org.openecomp.mso.rest.APIResponse; import org.openecomp.mso.rest.RESTClient @@ -45,17 +47,17 @@ import org.openecomp.mso.rest.RESTConfig */ class CatalogDbUtils { - + MsoUtils utils = new MsoUtils() JsonUtils jsonUtils = new JsonUtils() MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL); static private String defaultDbAdapterVersion = "v2" - public JSONArray getAllNetworksByServiceModelUuid(String catalogDbEndpoint, String serviceModelUuid) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") + public JSONArray getAllNetworksByServiceModelUuid(Execution execution, String serviceModelUuid) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") @@ -68,16 +70,21 @@ class CatalogDbUtils { return networksList } - - public JSONArray getAllNetworksByServiceModelUuid(String catalogDbEndpoint, String serviceModelUuid, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") + + public JSONArray getAllNetworksByServiceModelUuid(Execution execution, String serviceModelUuid, String catalogUtilsVersion) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + networksList = responseJson.getJSONArray("serviceNetworks") + } + else { + networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + } } } @@ -88,11 +95,11 @@ class CatalogDbUtils { return networksList } - public JSONArray getAllNetworksByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + public JSONArray getAllNetworksByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") @@ -105,16 +112,21 @@ class CatalogDbUtils { return networksList } - - public JSONArray getAllNetworksByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + public JSONArray getAllNetworksByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + networksList = responseJson.getJSONArray("serviceNetworks") + } + else { + networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + } } } @@ -125,11 +137,11 @@ class CatalogDbUtils { return networksList } - public JSONArray getAllNetworksByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + public JSONArray getAllNetworksByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") @@ -142,16 +154,21 @@ class CatalogDbUtils { return networksList } - - public JSONArray getAllNetworksByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + public JSONArray getAllNetworksByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + networksList = responseJson.getJSONArray("serviceNetworks") + } + else { + networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + } } } @@ -162,11 +179,11 @@ class CatalogDbUtils { return networksList } - public JSONArray getAllNetworksByNetworkModelCustomizationUuid(String catalogDbEndpoint, String networkModelCustomizationUuid) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?networkModelCustomizationUuid=" + UriUtils.encode(networkModelCustomizationUuid, "UTF-8") + public JSONArray getAllNetworksByNetworkModelCustomizationUuid(Execution execution, String networkModelCustomizationUuid) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?networkModelCustomizationUuid=" + UriUtils.encode(networkModelCustomizationUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") @@ -179,16 +196,21 @@ class CatalogDbUtils { return networksList } - - public JSONArray getAllNetworksByNetworkModelCustomizationUuid(String catalogDbEndpoint, String networkModelCustomizationUuid, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?networkModelCustomizationUuid=" + UriUtils.encode(networkModelCustomizationUuid, "UTF-8") + public JSONArray getAllNetworksByNetworkModelCustomizationUuid(Execution execution, String networkModelCustomizationUuid, String catalogUtilsVersion) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?networkModelCustomizationUuid=" + UriUtils.encode(networkModelCustomizationUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + networksList = responseJson.getJSONArray("serviceNetworks") + } + else { + networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + } } } @@ -199,11 +221,11 @@ class CatalogDbUtils { return networksList } - public JSONArray getAllNetworksByNetworkType(String catalogDbEndpoint, String networkType) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?networkType=" + UriUtils.encode(networkType, "UTF-8") + public JSONArray getAllNetworksByNetworkType(Execution execution, String networkType) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?networkType=" + UriUtils.encode(networkType, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", "v1") @@ -216,16 +238,21 @@ class CatalogDbUtils { return networksList } - - public JSONArray getAllNetworksByNetworkType(String catalogDbEndpoint, String networkType, String catalogUtilsVersion) { - JSONArray networksList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceNetworks?networkType=" + UriUtils.encode(networkType, "UTF-8") + + public JSONArray getAllNetworksByNetworkType(Execution execution, String networkType, String catalogUtilsVersion) { + JSONArray networksList = null + String endPoint = "/serviceNetworks?networkType=" + UriUtils.encode(networkType, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) - + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + networksList = responseJson.getJSONArray("serviceNetworks") + } + else { + networksList = parseNetworksJson(catalogDbResponse, "serviceNetworks", catalogUtilsVersion) + } } } @@ -237,12 +264,12 @@ class CatalogDbUtils { } - public JSONArray getAllVnfsByServiceModelUuid(String catalogDbEndpoint, String serviceModelUuid) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") + public JSONArray getAllVnfsByServiceModelUuid(Execution execution, String serviceModelUuid) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") @@ -255,17 +282,22 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllVnfsByServiceModelUuid(String catalogDbEndpoint, String serviceModelUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") + + public JSONArray getAllVnfsByServiceModelUuid(Execution execution, String serviceModelUuid, String catalogUtilsVersion) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) - + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceVnfs") + } + else { + vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) + } } } @@ -276,12 +308,12 @@ class CatalogDbUtils { return vnfsList } - public JSONArray getAllVnfsByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + public JSONArray getAllVnfsByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid) { + JSONArray vnfsList = null + String endPoint ="/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") @@ -294,17 +326,22 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllVnfsByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + + public JSONArray getAllVnfsByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) - + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceVnfs") + } + else { + vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) + } } } @@ -315,12 +352,12 @@ class CatalogDbUtils { return vnfsList } - public JSONArray getAllVnfsByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + public JSONArray getAllVnfsByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") @@ -333,17 +370,22 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllVnfsByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + + public JSONArray getAllVnfsByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) - + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceVnfs") + } + else { + vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) + } } } @@ -354,12 +396,12 @@ class CatalogDbUtils { return vnfsList } - public JSONArray getAllVnfsByVnfModelCustomizationUuid(String catalogDbEndpoint, String vnfModelCustomizationUuid) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?vnfModelCustomizationUuid=" + UriUtils.encode(vnfModelCustomizationUuid, "UTF-8") + public JSONArray getAllVnfsByVnfModelCustomizationUuid(Execution execution, String vnfModelCustomizationUuid) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?vnfModelCustomizationUuid=" + UriUtils.encode(vnfModelCustomizationUuid, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", "v1") @@ -373,16 +415,47 @@ class CatalogDbUtils { return vnfsList } - public JSONArray getAllVnfsByVnfModelCustomizationUuid(String catalogDbEndpoint, String vnfModelCustomizationUuid, String catalogUtilsVersion) { + /** + * This method gets a all vnfs for a particular + * service from the catalog database using the + * service model's model name. + * + * @param catalogDbEndpoint + * @param serviceModelModelName + * @return vnfsList * + * + */ + public JSONArray getAllVnfsByServiceModelModelName(Execution execution, String serviceModelModelName) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceVnfs?vnfModelCustomizationUuid=" + UriUtils.encode(vnfModelCustomizationUuid, "UTF-8") + String endPoint = "/serviceVnfs?serviceModelName=" + UriUtils.encode(serviceModelModelName, "UTF-8") try { msoLogger.debug("ENDPOINT: " + endPoint) - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) + vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", defaultDbAdapterVersion) + } + }catch (Exception e) { + utils.log("ERROR", "Exception in Querying Catalog DB: " + e.message) + } + return vnfsList + } + public JSONArray getAllVnfsByVnfModelCustomizationUuid(Execution execution, String vnfModelCustomizationUuid, String catalogUtilsVersion) { + JSONArray vnfsList = null + String endPoint = "/serviceVnfs?vnfModelCustomizationUuid=" + UriUtils.encode(vnfModelCustomizationUuid, "UTF-8") + try { + msoLogger.debug("ENDPOINT: " + endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) + + if (catalogDbResponse != null) { + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceVnfs") + } + else { + vnfsList = parseVnfsJson(catalogDbResponse, "serviceVnfs", catalogUtilsVersion) + } } } @@ -393,12 +466,69 @@ class CatalogDbUtils { return vnfsList } + /** + * This method gets a single vf module from + * the catalog database using the vf module's + * model name. It returns that vf module as + * a JSONObject + * + * @param catalogDbEndpoint + * @param vfModuleModelName + * @return vfModule + */ + public JSONObject getVfModuleByVfModuleModelName(Execution execution, String vfModuleModelName) { + JSONObject vfModule = null + String endPoint = "/vfModules?vfModuleModelName=" + UriUtils.encode(vfModuleModelName, "UTF-8") + try{ + msoLogger.debug("Get VfModule By VfModule ModelName Endpoint is: " + endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) + + if (catalogDbResponse != null) { + vfModule = parseVfModuleJson(catalogDbResponse, "vfModules", "v1") + } + } + catch(Exception e){ + utils.log("ERROR", "Exception in Querying Catalog DB: " + e.message) + } + + return vfModule + } + + /** + * This method gets a single vf module from + * the catalog database using the vf module's + * model name. It returns that vf module as + * a JSONObject + * + * @param catalogDbEndpoint + * @param vfModuleModelName + * @param catalogUtilsVersion + * @return vfModules + */ + public JSONObject getVfModuleByVfModuleModelName(Execution execution, String vfModuleModelName, String catalogUtilsVersion) { + JSONObject vfModule = null + String endPoint = "/vfModules?vfModuleModelName=" + UriUtils.encode(vfModuleModelName, "UTF-8") + try{ + msoLogger.debug("Get VfModule By VfModule ModelName Endpoint is: " + endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) - public JSONArray getAllottedResourcesByServiceModelUuid(String catalogDbEndpoint, String serviceModelUuid) { + if (catalogDbResponse != null) { + vfModule = parseVfModuleJson(catalogDbResponse, "vfModules", "v1") + } + } + catch(Exception e){ + utils.log("ERROR", "Exception in Querying Catalog DB: " + e.message) + } + + return vfModule + } + + + public JSONArray getAllottedResourcesByServiceModelUuid(Execution execution, String serviceModelUuid) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/ServiceAllottedResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") + String endPoint = "/ServiceAllottedResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") @@ -411,16 +541,21 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllottedResourcesByServiceModelUuid(String catalogDbEndpoint, String serviceModelUuid, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/ServiceAllottedResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") + public JSONArray getAllottedResourcesByServiceModelUuid(Execution execution, String serviceModelUuid, String catalogUtilsVersion) { + JSONArray vnfsList = null + String endPoint = "/ServiceAllottedResources?serviceModelUuid=" + UriUtils.encode(serviceModelUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceAllottedResources") + } + else { + vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + } } } @@ -431,11 +566,11 @@ class CatalogDbUtils { return vnfsList } - public JSONArray getAllottedResourcesByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid) { + public JSONArray getAllottedResourcesByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") @@ -448,30 +583,37 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllottedResourcesByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid, String catalogUtilsVersion) { + + public JSONArray getAllottedResourcesByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray() + } + else { + vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + } } } catch (Exception e) { utils.log("ERROR", "Exception in Querying Catalog DB: " + e.message) + utils.log("ERROR", "Exception in Querying Catalog DB: " + e.getStackTrace()) } return vnfsList } - public JSONArray getAllottedResourcesByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion) { + public JSONArray getAllottedResourcesByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") @@ -484,16 +626,21 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllottedResourcesByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { - JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + public JSONArray getAllottedResourcesByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { + JSONArray vnfsList = null + String endPoint = "/serviceAllottedResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceAllottedResources") + } + else { + vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + } } } @@ -504,11 +651,12 @@ class CatalogDbUtils { return vnfsList } - public JSONArray getAllottedResourcesByArModelCustomizationUuid(String catalogDbEndpoint, String arModelCustomizationUuid) { + + public JSONArray getAllottedResourcesByArModelCustomizationUuid(Execution execution, String arModelCustomizationUuid) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceAllottedResources?serviceModelCustomizationUuid=" + UriUtils.encode(arModelCustomizationUuid, "UTF-8") + String endPoint = "/serviceAllottedResources?serviceModelCustomizationUuid=" + UriUtils.encode(arModelCustomizationUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", "v1") @@ -521,15 +669,21 @@ class CatalogDbUtils { return vnfsList } - - public JSONArray getAllottedResourcesByArModelCustomizationUuid(String catalogDbEndpoint, String arModelCustomizationUuid, String catalogUtilsVersion) { + + public JSONArray getAllottedResourcesByArModelCustomizationUuid(Execution execution, String arModelCustomizationUuid, String catalogUtilsVersion) { JSONArray vnfsList = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceAllottedResources?serviceModelCustomizationUuid=" + UriUtils.encode(arModelCustomizationUuid, "UTF-8") + String endPoint = "/serviceAllottedResources?serviceModelCustomizationUuid=" + UriUtils.encode(arModelCustomizationUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + JSONObject responseJson = new JSONObject(catalogDbResponse) + vnfsList = responseJson.getJSONArray("serviceAllottedResources") + } + else { + vnfsList = parseAllottedResourcesJson(catalogDbResponse, "serviceAllottedResources", catalogUtilsVersion) + } } } @@ -540,14 +694,14 @@ class CatalogDbUtils { return vnfsList } - public JSONObject getServiceResourcesByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid) { + public JSONObject getServiceResourcesByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid) { JSONObject resources = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") - + String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { + resources = parseServiceResourcesJson(catalogDbResponse, "v1") } @@ -558,15 +712,20 @@ class CatalogDbUtils { return resources } - - public JSONObject getServiceResourcesByServiceModelInvariantUuid(String catalogDbEndpoint, String serviceModelInvariantUuid, String catalogUtilsVersion) { + + public JSONObject getServiceResourcesByServiceModelInvariantUuid(Execution execution, String serviceModelInvariantUuid, String catalogUtilsVersion) { JSONObject resources = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - resources = parseServiceResourcesJson(catalogDbResponse, catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + resources = new JSONObject(catalogDbResponse) + } + else { + resources = parseServiceResourcesJson(catalogDbResponse, catalogUtilsVersion) + } } } @@ -575,14 +734,14 @@ class CatalogDbUtils { } return resources - } - + } - public JSONObject getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion) { + + public JSONObject getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion) { JSONObject resources = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { resources = parseServiceResourcesJson(catalogDbResponse) @@ -595,15 +754,20 @@ class CatalogDbUtils { return resources } - - public JSONObject getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(String catalogDbEndpoint, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { + + public JSONObject getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(Execution execution, String serviceModelInvariantUuid, String serviceModelVersion, String catalogUtilsVersion) { JSONObject resources = null - String endPoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") + String endPoint = "/serviceResources?serviceModelInvariantUuid=" + UriUtils.encode(serviceModelInvariantUuid, "UTF-8") + "&serviceModelVersion=" + UriUtils.encode(serviceModelVersion, "UTF-8") try { - String catalogDbResponse = getResponseFromCatalogDb(endPoint) + String catalogDbResponse = getResponseFromCatalogDb(execution, endPoint) if (catalogDbResponse != null) { - resources = parseServiceResourcesJson(catalogDbResponse, catalogUtilsVersion) + if (!catalogUtilsVersion.equals("v1")) { + resources = new JSONObject(catalogDbResponse) + } + else { + resources = parseServiceResourcesJson(catalogDbResponse, catalogUtilsVersion) + } } } @@ -628,14 +792,14 @@ class CatalogDbUtils { modelInfos = new JSONArray() for (int i = 0; i < networks.length(); i++) { - + JSONObject network = networks.getJSONObject(i) JSONObject modelJson = new JSONObject() JSONObject modelInfo = buildModelInfo("network", network, catalogUtilsVersion) modelJson.put("modelInfo", modelInfo) String networkType = jsonUtils.getJsonValueForKey(network, "networkType") modelJson.put("networkType", networkType) - + switch (catalogUtilsVersion) { case "v1": break @@ -648,7 +812,7 @@ class CatalogDbUtils { modelJson.put("networkRole", networkRole) String networkScope = jsonUtils.getJsonValueForKey(network, "networkScope") modelJson.put("networkScope", networkScope) - break + break } modelInfos.put(modelJson) } @@ -665,7 +829,7 @@ class CatalogDbUtils { private JSONArray parseVnfsJson (String catalogDbResponse, String arrayName, String catalogUtilsVersion) { JSONArray modelInfos = null - + msoLogger.debug("parseVnfsJson - catalogUtilsVersion is " + catalogUtilsVersion) try { @@ -693,14 +857,15 @@ class CatalogDbUtils { String nfRole = jsonUtils.getJsonValueForKey(vnf, "nfRole") modelJson.put("nfRole", nfRole) String nfCode = jsonUtils.getJsonValueForKey(vnf, "nfCode") - modelJson.put("nfCode", nfCode) - break + modelJson.put("nfNamingCode", nfCode) + String nfFunction = jsonUtils.getJsonValueForKey(vnf, "nfFunction") + modelJson.put("nfFunction", nfFunction) + break } - JSONObject vnfJson = vnf.getJSONObject("vnf") JSONArray vfModules = null try { - vfModules = vnfJson.getJSONArray("vfModules") + vfModules = vnf.getJSONArray("vfModules") } catch (Exception e) { msoLogger.debug("Cannot find VF MODULE ARRAY: " + i + ", exception is " + e.message) @@ -729,7 +894,7 @@ class CatalogDbUtils { boolean isBase = jsonUtils.getJsonBooleanValueForKey(vfModule, "isBase") vfModuleModelJson.put("isBase", isBase) break - } + } String vfModuleLabel = jsonUtils.getJsonValueForKey(vfModule, "label") vfModuleModelJson.put("vfModuleLabel", vfModuleLabel) Integer initialCount = jsonUtils.getJsonIntValueForKey(vfModule, "initialCount") @@ -740,7 +905,7 @@ class CatalogDbUtils { } modelInfos.put(modelJson) } - + String modelInfosString = modelInfos.toString() msoLogger.debug("Returning vnfs JSON: " + modelInfosString) @@ -751,9 +916,61 @@ class CatalogDbUtils { return modelInfos } + /** + * This method parses a Vf Module from the + * Vf Modules array + * + * @param catalogDbResponse + * @param arrayName + * @param catalogUtilsVersion + * @return vfModulelJson + */ + private JSONObject parseVfModuleJson (String catalogDbResponse, String arrayName, String catalogUtilsVersion) { + JSONObject vfModulelJson = new JSONObject() + msoLogger.debug("Started Parse Vf Module Json") + try { + JSONObject responseJson = new JSONObject(catalogDbResponse) + JSONArray vfModules = responseJson.getJSONArray(arrayName) + if(vfModules != null){ + JSONObject vfModuleInfo = new JSONObject() + for (int i = 0; i < vfModules.length(); i++) { + JSONObject vfModule = vfModules.getJSONObject(i) + JSONObject vfModuleModelInfo = buildModelInfo("vfModule", vfModule, catalogUtilsVersion) + vfModulelJson.put("modelInfo", vfModuleModelInfo) + String vfModuleType = jsonUtils.getJsonValueForKey(vfModule, "type") + vfModulelJson.put("vfModuleType", vfModuleType) + switch(catalogUtilsVersion) { + case "v1": + Integer isBase = jsonUtils.getJsonIntValueForKey(vfModule, "isBase") + if (isBase.intValue() == 1) { + vfModulelJson.put("isBase", "true") + } + else { + vfModulelJson.put("isBase", "false") + } + break + default: + boolean isBase = jsonUtils.getJsonBooleanValueForKey(vfModule, "isBase") + vfModulelJson.put("isBase", isBase) + break + } + String vfModuleLabel = jsonUtils.getJsonValueForKey(vfModule, "label") + vfModulelJson.put("vfModuleLabel", vfModuleLabel) + Integer initialCount = jsonUtils.getJsonIntValueForKey(vfModule, "initialCount") + vfModulelJson.put("initialCount", initialCount.intValue()) + } + } + msoLogger.debug("Completed Parsing Vf Module: " + vfModulelJson.toString()) + }catch (Exception e){ + utils.log("DEBUG", "Exception while parsing Vf Modules from Catalog DB Response: " + e.message) + } + + return vfModulelJson + } + private JSONArray parseAllottedResourcesJson (String catalogDbResponse, String arrayName, String catalogUtilsVersion) { JSONArray modelInfos = null - + msoLogger.debug("parseAllottedResourcesJson - catalogUtilsVersion is " + catalogUtilsVersion) try { @@ -774,12 +991,20 @@ class CatalogDbUtils { default: String toscaNodeType = jsonUtils.getJsonValueForKey(allottedResource, "toscaNodeType") modelJson.put("toscaNodeType", toscaNodeType) + String nfType = jsonUtils.getJsonValueForKey(allottedResource, "nfType") + modelJson.put("nfType", nfType) + String nfRole = jsonUtils.getJsonValueForKey(allottedResource, "nfRole") + modelJson.put("nfRole", nfRole) + String nfCode = jsonUtils.getJsonValueForKey(allottedResource, "nfCode") + modelJson.put("nfNamingCode", nfCode) + String nfFunction = jsonUtils.getJsonValueForKey(allottedResource, "nfFunction") + modelJson.put("nfFunction", nfFunction) String parentServiceModelUuid = jsonUtils.getJsonValueForKey(allottedResource, "parentServiceModelUuid") modelJson.put("parentServiceModelUuid", parentServiceModelUuid) break } - - + + modelInfos.put(modelJson) } @@ -818,17 +1043,17 @@ class CatalogDbUtils { return serviceResources } - + private JSONObject parseServiceResourcesJson (String catalogDbResponse, String catalogUtilsVersion) { JSONObject serviceResources = new JSONObject() JSONObject serviceResourcesObject = new JSONObject() - String serviceResourcesString = "" + String serviceResourcesString = "" try { // Create array of jsons JSONObject responseJson = new JSONObject(catalogDbResponse) - JSONObject serviceResourcesRoot = responseJson.getJSONObject("serviceResources") + JSONObject serviceResourcesRoot = responseJson.getJSONObject("serviceResources") JSONObject modelInfo = buildModelInfo("", serviceResourcesRoot, catalogUtilsVersion) serviceResources.put("modelInfo", modelInfo) JSONArray vnfsArray = parseVnfsJson(serviceResourcesRoot.toString(), "serviceVnfs", catalogUtilsVersion) @@ -860,7 +1085,7 @@ class CatalogDbUtils { String modelInstanceName = jsonUtils.getJsonValueForKey(modelFromDb, "modelInstanceName") modelInfo.put("modelInstanceName", modelInstanceName) } - if (!"vfModule".equals(modelType) && !"vnf".equals(modelType)) { + if ((!"vfModule".equals(modelType) && !"vnf".equals(modelType)) || !catalogUtilsVersion.equals("v1")) { String modelVersionId = jsonUtils.getJsonValueForKey(modelFromDb, "modelUuid") modelInfo.put("modelVersionId", modelVersionId) } @@ -884,7 +1109,7 @@ class CatalogDbUtils { default: modelInfo.put("modelCustomizationUuid", modelCustomizationId) break - } + } JSONObject modelJson = new JSONObject() modelJson.put("modelInfo", modelInfo) } @@ -894,17 +1119,24 @@ class CatalogDbUtils { return modelInfo } - private String getResponseFromCatalogDb (String endPoint) { + private String getResponseFromCatalogDb (Execution execution, String endPoint) { try { - RESTConfig config = new RESTConfig(endPoint); + String catalogDbEndpoint = execution.getVariable("URN_mso_catalog_db_endpoint") + String queryEndpoint = catalogDbEndpoint + "/" + defaultDbAdapterVersion + endPoint + RESTConfig config = new RESTConfig(queryEndpoint); def responseData = '' def bpmnRequestId = UUID.randomUUID().toString() RESTClient client = new RESTClient(config). - addHeader('X-TransactionId', bpmnRequestId). - addHeader('X-FromAppId', 'BPMN'). - addHeader('Content-Type', 'application/json'). - addHeader('Accept','application/json'); - msoLogger.debug('sending GET to Catalog DB endpoint' + endPoint) + addHeader('X-TransactionId', bpmnRequestId). + addHeader('X-FromAppId', 'BPMN'). + addHeader('Content-Type', 'application/json'). + addHeader('Accept','application/json'); + + String basicAuthCred = execution.getVariable("BasicAuthHeaderValueDB") + if (basicAuthCred != null && !"".equals(basicAuthCred)) { + client.addAuthorizationHeader(basicAuthCred) + } + msoLogger.debug('sending GET to Catalog DB endpoint: ' + endPoint) APIResponse response = client.httpGet() responseData = response.getResponseBodyAsString() @@ -928,4 +1160,4 @@ class CatalogDbUtils { } } -} +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcess.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcess.groovy index 2f9c8d299b..86a4f6a068 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcess.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcess.groovy @@ -83,6 +83,9 @@ public class CompleteMsoProcess extends AbstractServiceTaskProcessor { def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') // utils.log("DEBUG", "*** Started CompleteMsoProcess preProcessRequest Method ***", isDebugLogEnabled); logDebug('Entered ' + method, isDebugLogEnabled) + + setBasicDBAuthHeader(execution, isDebugLogEnabled) + try { def xml = execution.getVariable("CompleteMsoProcessRequest") @@ -167,109 +170,14 @@ public class CompleteMsoProcess extends AbstractServiceTaskProcessor { // utils.log("DEBUG", "*** Completed CompleteMsoProcess preProcessRequest Method ***", isDebugLogEnabled); } - public void postProcessResponse (Execution execution) { - - def method = getClass().getSimpleName() + '.postProcessResponse(' +'execution=' + execution.getId() +')' - def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') - logDebug('Entered ' + method, isDebugLogEnabled) -// utils.log("DEBUG", "*** Started CompleteMsoProcess PostProcessRequest Method ***", isDebugLogEnabled); - try { - - def msoCompletionResponse = """ - - BPEL ${execution.getVariable("CMSO_mso-bpel-name")} completed - - """.trim() - - // Format Response - def xmlMsoCompletionResponse = utils.formatXML(msoCompletionResponse) - String buildMsoCompletionResponseAsString = xmlMsoCompletionResponse.drop(38).trim() - // TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead - execution.setVariable("WorkflowResponse", buildMsoCompletionResponseAsString) - utils.logAudit("CompleteMsoProcess Response: " + buildMsoCompletionResponseAsString) - execution.setVariable("CompleteMsoProcessResponse", buildMsoCompletionResponseAsString) - execution.setVariable("CMSO_ResponseCode", "200") - - setSuccessIndicator(execution, true) - - utils.log("DEBUG", "@@ CompleteMsoProcess Response @@ " + "\n" + execution.getVariable("CompleteMsoProcessResponse"), isDebugLogEnabled) - - logDebug('Exited ' + method, isDebugLogEnabled) - } catch (BpmnError e) { - throw e; - } catch (Exception e) { - logError('Caught exception in ' + method, e) - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method) - } -// utils.log("DEBUG", "*** Completed CompleteMsoProcess PostProcessRequest Method ***", isDebugLogEnabled); - - } - - public void updateDBStatusToSuccessPayload (Execution execution){ - def method = getClass().getSimpleName() + '.updateDBStatusToSuccessPayload(' +'execution=' + execution.getId() +')' - def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') - logDebug('Entered ' + method, isDebugLogEnabled) - - try { - // Catalog DB headers Authorization - String basicAuthValueDB = execution.getVariable("URN_mso_adapters_db_auth") - utils.log("DEBUG", " Obtained BasicAuth userid password for Catalog DB adapter: " + basicAuthValueDB, isDebugLogEnabled) - - def encodedString = utils.getBasicAuth(basicAuthValueDB, execution.getVariable("URN_mso_msoKey")) - execution.setVariable("BasicAuthHeaderValueDB",encodedString) - } catch (IOException ex) { - String dataErrorMessage = " Unable to encode Catalog DB user/password string - " + ex.getMessage() - utils.log("DEBUG", dataErrorMessage, isDebugLogEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - - try { - - String payload = """ - - - - - ${execution.getVariable("CMSO_request_id")} - BPEL - COMPLETED - - - - """ - execution.setVariable("CMSO_updateDBStatusToSuccessPayload", payload) - utils.logAudit("updateDBStatusToSuccessPayload: " + payload) - logDebug('Exited ' + method, isDebugLogEnabled) - //println("CMSO_updateDBStatusToSuccessPayload --> " + execution.getVariable("CMSO_updateDBStatusToSuccessPayload")) - - } catch (BpmnError e) { - throw e; - } catch (Exception e) { - logError('Caught exception in ' + method, e) - exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method) - } - } - public void setUpdateDBstatustoSuccessPayload (Execution execution){ def method = getClass().getSimpleName() + '.setUpdateDBstatustoSuccessPayload(' +'execution=' + execution.getId() +')' def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') logDebug('Entered ' + method, isDebugLogEnabled) - - try { - String basicAuthValueDB = execution.getVariable("URN_mso_adapters_db_auth") - utils.log("DEBUG", " Obtained BasicAuth userid password for Catalog DB adapter: " + basicAuthValueDB, isDebugLogEnabled) - - def encodedString = utils.getBasicAuth(basicAuthValueDB, execution.getVariable("URN_mso_msoKey")) - execution.setVariable("BasicAuthHeaderValueDB",encodedString) - } catch (IOException ex) { - String dataErrorMessage = " Unable to encode Catalog DB user/password string - " + ex.getMessage() - utils.log("DEBUG", dataErrorMessage, isDebugLogEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } - + try { - + def xml = execution.getVariable("CompleteMsoProcessRequest") //Get statusMessage if exists @@ -357,5 +265,44 @@ public class CompleteMsoProcess extends AbstractServiceTaskProcessor { } } + + public void postProcessResponse (Execution execution) { + + def method = getClass().getSimpleName() + '.postProcessResponse(' +'execution=' + execution.getId() +')' + def isDebugLogEnabled = execution.getVariable('isDebugLogEnabled') + logDebug('Entered ' + method, isDebugLogEnabled) + // utils.log("DEBUG", "*** Started CompleteMsoProcess PostProcessRequest Method ***", isDebugLogEnabled); + try { + + def msoCompletionResponse = """ + + BPEL ${execution.getVariable("CMSO_mso-bpel-name")} completed + + """.trim() + + // Format Response + def xmlMsoCompletionResponse = utils.formatXML(msoCompletionResponse) + String buildMsoCompletionResponseAsString = xmlMsoCompletionResponse.drop(38).trim() + // TODO: Should deprecate use of processKey+Response variable for the response. Will use "WorkflowResponse" instead + execution.setVariable("WorkflowResponse", buildMsoCompletionResponseAsString) + utils.logAudit("CompleteMsoProcess Response: " + buildMsoCompletionResponseAsString) + execution.setVariable("CompleteMsoProcessResponse", buildMsoCompletionResponseAsString) + execution.setVariable("CMSO_ResponseCode", "200") + + setSuccessIndicator(execution, true) + + utils.log("DEBUG", "@@ CompleteMsoProcess Response @@ " + "\n" + execution.getVariable("CompleteMsoProcessResponse"), isDebugLogEnabled) + + logDebug('Exited ' + method, isDebugLogEnabled) + } catch (BpmnError e) { + throw e; + } catch (Exception e) { + logError('Caught exception in ' + method, e) + exceptionUtil.buildAndThrowWorkflowException(execution, 2000, "Internal Error - Occured in" + method) + } + // utils.log("DEBUG", "*** Completed CompleteMsoProcess PostProcessRequest Method ***", isDebugLogEnabled); + + } + } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CreateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CreateAAIVfModule.groovy index 9cf22aaf4a..301ee3efbc 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CreateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/CreateAAIVfModule.groovy @@ -257,7 +257,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ ${execution.getVariable("CAAIVfMod_vnfName")} ${execution.getVariable("CAAIVfMod_vnfType")} ${execution.getVariable("CAAIVfMod_serviceId")} - active + Active ${execution.getVariable("CAAIVfMod_vnfPersonaId")} ${execution.getVariable("CAAIVfMod_vnfPersonaVer")} """ as String diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy new file mode 100644 index 0000000000..e5b46e2d25 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/DecomposeService.groovy @@ -0,0 +1,160 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common.scripts; + +import static org.apache.commons.lang3.StringUtils.*; + + +import org.apache.commons.lang3.* +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.runtime.Execution +import org.json.JSONObject; +import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.openecomp.mso.bpmn.common.scripts.CatalogDbUtils +import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil +import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition +import org.openecomp.mso.bpmn.core.json.JsonUtils + +import com.att.ecomp.mso.bpmn.core.domain.* + +import groovy.json.* + +/** + * This groovy class supports the DecomposeService.bpmn process. + * + * @author + * + * Inputs: + * @param - msoRequestId + * @param - isDebugLogEnabled + * @param - serviceInstanceId + * @param - serviceModelInfo + * @param - requestParameters (may be null) + * + * Outputs: + * @param - rollbackData (null) + * @param - rolledBack (null) + * @param - WorkflowException + * @param - serviceDecomposition + * + */ +public class DecomposeService extends AbstractServiceTaskProcessor { + + String Prefix="DDS_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + CatalogDbUtils catalogDbUtils = new CatalogDbUtils() + JsonUtils jsonUtils = new JsonUtils() + + public void preProcessRequest (Execution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** preProcessRequest of DecomposeService *****", isDebugEnabled) + setBasicDBAuthHeader(execution, isDebugEnabled) + + try { + execution.setVariable("prefix", Prefix) + // check for required input + String requestId = execution.getVariable("msoRequestId") + String serviceInstanceId = execution.getVariable("serviceInstanceId") + String serviceModelInfo = execution.getVariable("serviceModelInfo") + execution.setVariable("DDS_serviceModelInvariantId", jsonUtils.getJsonValue(serviceModelInfo, "modelInvariantUuid")) + execution.setVariable("DDS_modelVersion", jsonUtils.getJsonValue(serviceModelInfo, "modelVersion")) + } catch (BpmnError e) { + throw e; + } catch (Exception ex){ + msg = "Exception in preProcessRequest " + ex.getMessage() + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit preProcessRequest of DecomposeService *****", isDebugEnabled) + } + + public void queryCatalogDb (Execution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** queryCatalogDB of DecomposeService *****", isDebugEnabled) + + try { + + // check for input + String serviceModelInvariantId = execution.getVariable("DDS_serviceModelInvariantId") + String modelVersion = execution.getVariable("DDS_modelVersion") + + utils.log("DEBUG", "serviceModelInvariantId: " + serviceModelInvariantId, isDebugEnabled) + utils.log("DEBUG", "modelVersion: " + modelVersion, isDebugEnabled) + + JSONObject catalogDbResponse = null + + if (modelVersion != null && modelVersion.length() > 0) + catalogDbResponse = catalogDbUtils.getServiceResourcesByServiceModelInvariantUuidAndServiceModelVersion(execution, serviceModelInvariantId, modelVersion, "v2") + else + catalogDbResponse = catalogDbUtils.getServiceResourcesByServiceModelInvariantUuid(execution, serviceModelInvariantId, "v2") + String catalogDbResponseString = catalogDbResponse.toString() + + execution.setVariable("DDS_catalogDbResponse", catalogDbResponseString) + utils.log("DEBUG", "catalog DB response string: "+ catalogDbResponseString, isDebugEnabled) + + } catch (BpmnError e) { + throw e; + } catch (Exception ex){ + msg = "Exception in queryCatalogDb " + ex.getMessage() + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit queryCatalogDb of DecomposeService *****", isDebugEnabled) + } + + + + public void actuallyDecomposeService (Execution execution) { + def isDebugEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** actuallyDecomposeService of DecomposeService *****", isDebugEnabled) + + try { + + // check for input + String requestId = execution.getVariable("msoRequestId") + String serviceInstanceId = execution.getVariable("serviceInstanceId") + String serviceModelInvariantId = execution.getVariable("DDS_serviceModelInvariantId") + + utils.log("DEBUG", "serviceModelInvariantId: " + serviceModelInvariantId, isDebugEnabled) + + utils.log("DEBUG", "getting service decomposition", isDebugEnabled) + + String catalogDbResponse = execution.getVariable("DDS_catalogDbResponse") + ServiceDecomposition serviceDecomposition = new ServiceDecomposition(catalogDbResponse, serviceInstanceId) + + execution.setVariable("serviceDecomposition", serviceDecomposition) + execution.setVariable("serviceDecompositionString", serviceDecomposition.toJsonString()) + + utils.log("DEBUG", "service decomposition: "+ serviceDecomposition.toJsonString(), isDebugEnabled) + + } catch (BpmnError e) { + throw e; + } catch (Exception ex){ + msg = "Exception in actuallyDecomposeService " + ex.getMessage() + utils.log("DEBUG", msg, isDebugEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit actuallyDecomposeService of DecomposeService *****", isDebugEnabled) + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandler.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandler.groovy index 282cbb3c69..a97e86bb3f 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandler.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandler.groovy @@ -101,18 +101,8 @@ public class FalloutHandler extends AbstractServiceTaskProcessor { // Initialize flow variables initializeProcessVariables(execution) setSuccessIndicator(execution, false) - - try { - String basicAuthValueDB = execution.getVariable("URN_mso_adapters_db_auth") - utils.log("DEBUG", " Obtained BasicAuth userid password for Catalog DB adapter: " + basicAuthValueDB, isDebugLogEnabled) - - def encodedString = utils.getBasicAuth(basicAuthValueDB, execution.getVariable("URN_mso_msoKey")) - execution.setVariable("BasicAuthHeaderValueDB",encodedString) - } catch (IOException ex) { - String dataErrorMessage = " Unable to encode Catalog DB user/password string - " + ex.getMessage() - utils.log("DEBUG", dataErrorMessage, isDebugLogEnabled) - exceptionUtil.buildAndThrowWorkflowException(execution, 2500, dataErrorMessage) - } + + setBasicDBAuthHeader(execution, isDebugLogEnabled) try { def xml = execution.getVariable("FalloutHandlerRequest") @@ -285,7 +275,7 @@ public class FalloutHandler extends AbstractServiceTaskProcessor { try { String payload = """ - + diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/GenericGetService.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/GenericGetService.groovy index 2e65339270..dcc093bc31 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/GenericGetService.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/GenericGetService.groovy @@ -87,9 +87,6 @@ import org.springframework.web.util.UriUtils * @param - GENGS_service * @param - GENGS_FoundIndicator * @param - WorkflowException - * - * - * @author cb645j */ class GenericGetService extends AbstractServiceTaskProcessor{ @@ -103,7 +100,6 @@ class GenericGetService extends AbstractServiceTaskProcessor{ * * @param - execution * - * @author cb645j */ public void preProcessRequest(Execution execution) { def isDebugEnabled = execution.getVariable("isDebugLogEnabled") diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/ManualHandling.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/ManualHandling.groovy new file mode 100644 index 0000000000..ad3cc3b08f --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/ManualHandling.groovy @@ -0,0 +1,253 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common.scripts; + +import static org.apache.commons.lang3.StringUtils.*; + +import java.time.chrono.AbstractChronology +import java.util.List + +import org.apache.commons.lang3.* +import org.camunda.bpm.engine.TaskService +import org.camunda.bpm.engine.task.Task +import org.camunda.bpm.engine.task.TaskQuery +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.delegate.DelegateTask +import org.camunda.bpm.engine.delegate.DelegateExecution +import org.camunda.bpm.engine.runtime.Execution +import org.json.JSONObject; +import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil +import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition +import org.openecomp.mso.bpmn.core.json.JsonUtils + + + +/** + * This groovy class supports the ManualHandling.bpmn process. + * + * @author + * + * Inputs: + * @param - msoRequestId + * @param - isDebugLogEnabled + * @param - serviceType + * @param - vnfType + * @param - requestorId + * @param - currentActivity + * @param - workStep + * @param - failedActivity + * @param - errorCode + * @param - errorText + * @param - validResponses + * + * Outputs: + * @param - WorkflowException + * @param - taskId + * + */ +public class ManualHandling extends AbstractServiceTaskProcessor { + + String Prefix="MH_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + + JsonUtils jsonUtils = new JsonUtils() + + public void preProcessRequest (Execution execution) { + def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** preProcessRequest of ManualHandling *****", isDebugLogEnabled) + + try { + execution.setVariable("prefix", Prefix) + // check for required input + String requestId = execution.getVariable("msoRequestId") + utils.log("DEBUG", "msoRequestId is: " + requestId, isDebugLogEnabled) + def serviceType = execution.getVariable("serviceType") + utils.log("DEBUG", "serviceType is: " + serviceType, isDebugLogEnabled) + def vnfType = execution.getVariable("vnfType") + utils.log("DEBUG", "vnftype is: " + vnfType, isDebugLogEnabled) + def currentActivity = execution.getVariable("currentActivity") + utils.log("DEBUG", "currentActivity is: " + currentActivity, isDebugLogEnabled) + def workStep = execution.getVariable("workStep") + utils.log("DEBUG", "workStep is: " + workStep, isDebugLogEnabled) + def failedActivity = execution.getVariable("failedActivity") + utils.log("DEBUG", "failedActivity is: " + failedActivity, isDebugLogEnabled) + def errorCode = execution.getVariable("errorCode") + utils.log("DEBUG", "errorCode is: " + errorCode, isDebugLogEnabled) + def errorText = execution.getVariable("errorText") + utils.log("DEBUG", "errorText is: " + errorText, isDebugLogEnabled) + def requestorId = execution.getVariable("requestorId") + utils.log("DEBUG", "requestorId is: " + requestorId, isDebugLogEnabled) + def validResponses = execution.getVariable("validResponses") + utils.log("DEBUG", "validResponses is: " + validResponses, isDebugLogEnabled) + + } catch (BpmnError e) { + throw e; + } catch (Exception ex){ + msg = "Exception in preProcessRequest " + ex.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit preProcessRequest of RainyDayHandler *****", isDebugLogEnabled) + } + + public void createManualTask (Execution execution) { + def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** createManualTask of ManualHandling *****", isDebugLogEnabled) + + try { + String taskId = UUID.randomUUID() + execution.setVariable('taskId', taskId) + String type = "fallout" + String nfRole = execution.getVariable("vnfType") + String subscriptionServiceType = execution.getVariable("serviceType") + String originalRequestId = execution.getVariable("msoRequestId") + String originalRequestorId = execution.getVariable("requestorId") + String errorSource = execution.getVariable("failedActivity") + String errorCode = execution.getVariable("errorCode") + String errorMessage = execution.getVariable("errorText") + String buildingBlockName = execution.getVariable("currentActivity") + String buildingBlockStep = execution.getVariable("workStep") + String validResponses = execution.getVariable("validResponses") + + utils.log("DEBUG", "Before creating task", isDebugLogEnabled) + + Map taskVariables = new HashMap() + taskVariables.put("type", type) + taskVariables.put("nfRole", nfRole) + taskVariables.put("subscriptionServiceType", subscriptionServiceType) + taskVariables.put("originalRequestId", originalRequestId) + taskVariables.put("originalRequestorId", originalRequestorId) + taskVariables.put("errorSource", errorSource) + taskVariables.put("errorCode", errorCode) + taskVariables.put("errorMessage", errorMessage) + taskVariables.put("buildingBlockName", buildingBlockName) + taskVariables.put("buildingBlockStep", buildingBlockStep) + taskVariables.put("validResponses", validResponses) + + TaskService taskService = execution.getProcessEngineServices().getTaskService() + Task manualTask = taskService.newTask(taskId) + taskService.saveTask(manualTask) + taskService.setVariables(taskId, taskVariables) + utils.log("DEBUG", "successfully created task: "+ taskId, isDebugLogEnabled) + + } catch (BpmnError e) { + utils.log("DEBUG", "BPMN exception: " + e.errorMessage, isDebugLogEnabled) + throw e; + } catch (Exception ex){ + msg = "Exception in createManualTask " + ex.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit createManualTask of ManualHandling *****", isDebugLogEnabled) + } + + public void setTaskVariables (DelegateTask task) { + + DelegateExecution execution = task.getExecution() + + def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** setTaskVariables of ManualHandling *****", isDebugLogEnabled) + String taskId = task.getId() + utils.log("DEBUG", "taskId is: " + taskId, isDebugLogEnabled) + + try { + execution.setVariable('taskId', taskId) + String type = "fallout" + String nfRole = execution.getVariable("vnfType") + String subscriptionServiceType = execution.getVariable("serviceType") + String originalRequestId = execution.getVariable("msoRequestId") + String originalRequestorId = execution.getVariable("requestorId") + String errorSource = execution.getVariable("failedActivity") + String errorCode = execution.getVariable("errorCode") + String errorMessage = execution.getVariable("errorText") + String buildingBlockName = execution.getVariable("currentActivity") + String buildingBlockStep = execution.getVariable("workStep") + String validResponses = execution.getVariable("validResponses") + + utils.log("DEBUG", "Before creating task", isDebugLogEnabled) + + Map taskVariables = new HashMap() + taskVariables.put("type", type) + taskVariables.put("nfRole", nfRole) + taskVariables.put("subscriptionServiceType", subscriptionServiceType) + taskVariables.put("originalRequestId", originalRequestId) + taskVariables.put("originalRequestorId", originalRequestorId) + taskVariables.put("errorSource", errorSource) + taskVariables.put("errorCode", errorCode) + taskVariables.put("errorMessage", errorMessage) + taskVariables.put("buildingBlockName", buildingBlockName) + taskVariables.put("buildingBlockStep", buildingBlockStep) + taskVariables.put("validResponses", validResponses) + TaskService taskService = execution.getProcessEngineServices().getTaskService() + + + taskService.setVariables(taskId, taskVariables) + utils.log("DEBUG", "successfully created task: "+ taskId, isDebugLogEnabled) + + } catch (BpmnError e) { + utils.log("DEBUG", "BPMN exception: " + e.errorMessage, isDebugLogEnabled) + throw e; + } catch (Exception ex){ + msg = "Exception in createManualTask " + ex.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit createManualTask of ManualHandling *****", isDebugLogEnabled) + } + + public void completeTask (DelegateTask task) { + + DelegateExecution execution = task.getExecution() + + def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** completeTask of ManualHandling *****", isDebugLogEnabled) + String taskId = task.getId() + utils.log("DEBUG", "taskId is: " + taskId, isDebugLogEnabled) + + try { + TaskService taskService = execution.getProcessEngineServices().getTaskService() + + Map taskVariables = taskService.getVariables(taskId) + String responseValue = taskVariables.get("responseValue") + + utils.log("DEBUG", "Received responseValue on completion: "+ responseValue, isDebugLogEnabled) + // Have to set the first letter of the response to upper case + String responseValueForRainyDay = responseValue.substring(0, 1).toUpperCase() + responseValue.substring(1) + utils.log("DEBUG", "ResponseValue to RainyDayHandler: "+ responseValueForRainyDay, isDebugLogEnabled) + execution.setVariable("responseValue", responseValueForRainyDay) + + } catch (BpmnError e) { + utils.log("DEBUG", "BPMN exception: " + e.errorMessage, isDebugLogEnabled) + throw e; + } catch (Exception ex){ + msg = "Exception in createManualTask " + ex.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit completeTask of ManualHandling *****", isDebugLogEnabled) + } + + +} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy index 26c30491bc..41b86c90e7 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/MsoUtils.groovy @@ -858,6 +858,8 @@ class MsoUtils { * @return base 64 encoded basic auth credentials */ def getBasicAuth(encryptedAuth, msoKey){ + if ((encryptedAuth == null || encryptedAuth.isEmpty()) || (msoKey == null || msoKey.isEmpty())) + return null try { def auth = decrypt(encryptedAuth, msoKey) byte[] encoded = Base64.encodeBase64(auth.getBytes()) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtils.groovy index 3ff2863d54..4c4f1749ed 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtils.groovy @@ -73,7 +73,7 @@ class NetworkUtils { * @param requestInput the request in the process * @param queryIdResponse the response of REST AAI query by Id * @param routeCollection the collection - * @param policyFqdns the policy + * @param policyFqdns the policy * @param tableCollection the collection * @param cloudRegionId the cloud-region-region * @return String request @@ -84,12 +84,12 @@ class NetworkUtils { String serviceInstanceId = "" String sharedValue = "" String externalValue = "" - + if (source == "VID") { sharedValue = utils.getNodeText1(queryIdResponse, "is-shared-network") != null ? utils.getNodeText1(queryIdResponse, "is-shared-network") : "false" externalValue = utils.getNodeText1(queryIdResponse, "is-external-network") != null ? utils.getNodeText1(queryIdResponse, "is-external-network") : "false" serviceInstanceId = utils.getNodeText1(requestInput, "service-instance-id") - + } else { // source = 'PORTAL' sharedValue = getParameterValue(requestInput, "shared") externalValue = getParameterValue(requestInput, "external") @@ -101,24 +101,28 @@ class NetworkUtils { String netParams = utils.getNodeXml(requestInput, "network-params", false).replace("tag0:","").replace(":tag0","") networkParams = buildParams(netParams) } - + String failIfExists = "false" // requestInput String cloudRegion = cloudRegionId String tenantId = utils.getNodeText1(requestInput, "tenant-id") + String networkType = "" + String modelCustomizationUuid = "" if (utils.nodeExists(requestInput, "networkModelInfo")) { String networkModelInfo = utils.getNodeXml(requestInput, "networkModelInfo", false).replace("tag0:","").replace(":tag0","") networkType = utils.getNodeText1(networkModelInfo, "modelName") + modelCustomizationUuid = utils.getNodeText1(networkModelInfo, "modelCustomizationUuid") } else { - networkType = utils.getNodeText1(queryIdResponse, "network-type") + networkType = utils.getNodeText1(queryIdResponse, "network-type") + modelCustomizationUuid = utils.getNodeText1(requestInput, "modelCustomizationId") } - + // queryIdResponse String networkName = utils.getNodeText1(queryIdResponse, "network-name") String networkId = utils.getNodeText1(queryIdResponse, "network-id") String networkTechnology = utils.getNodeText1(queryIdResponse, "network-technology") - + // contrailNetwork - networkTechnology = 'Contrail' vs. 'AIC_SR_IOV') String contrailNetwork = "" if (networkTechnology.contains('Contrail') || networkTechnology.contains('contrail') || networkTechnology.contains('CONTRAIL')) { @@ -131,7 +135,7 @@ class NetworkUtils { """ networkTechnology = "CONTRAIL" // replace } - + // rebuild subnets String subnets = "" if (utils.nodeExists(queryIdResponse, "subnets")) { @@ -140,10 +144,10 @@ class NetworkUtils { } String physicalNetworkName = "" - physicalNetworkName = utils.getNodeText1(queryIdResponse, "physical-network-name") - + physicalNetworkName = utils.getNodeText1(queryIdResponse, "physical-network-name") + String vlansCollection = buildVlans(queryIdResponse) - + String notificationUrl = "" //TODO - is this coming from URN? What variable/value to use? //String notificationUrl = execution.getVariable("URN_?????") //TODO - is this coming from URN? What variable/value to use? @@ -165,7 +169,7 @@ class NetworkUtils { true ${backoutOnFailure} ${failIfExists} - ${networkParams} + ${networkParams} ${requestId} ${serviceInstanceId} @@ -176,9 +180,9 @@ class NetworkUtils { """.trim() } return createNetworkRequest - + } - + /** * This method returns the string for Network request * V2 for Contrail 3.x will populate cloud-region data in same cloudSiteId filed @@ -197,18 +201,18 @@ class NetworkUtils { String serviceInstanceId = "" String sharedValue = "" String externalValue = "" - + if (source == "VID") { sharedValue = utils.getNodeText1(queryIdResponse, "is-shared-network") != null ? utils.getNodeText1(queryIdResponse, "is-shared-network") : "false" externalValue = utils.getNodeText1(queryIdResponse, "is-external-network") != null ? utils.getNodeText1(queryIdResponse, "is-external-network") : "false" serviceInstanceId = utils.getNodeText1(requestInput, "service-instance-id") - + } else { // source = 'PORTAL' sharedValue = getParameterValue(requestInput, "shared") externalValue = getParameterValue(requestInput, "external") serviceInstanceId = utils.getNodeText1(requestInput, "service-instance-id") != null ? utils.getNodeText1(requestInput, "service-instance-id") : "" } - + String failIfExists = "false" // requestInput String cloudRegion = cloudRegionId @@ -226,9 +230,9 @@ class NetworkUtils { modelCustomizationUuid = utils.getNodeText1(networkModelInfo, "modelCustomizationUuid") } else { networkType = utils.getNodeText1(queryIdResponse, "network-type") + modelCustomizationUuid = utils.getNodeText1(requestInput, "modelCustomizationId") } - // rebuild subnets String subnets = "" if (utils.nodeExists(queryIdResponse, "subnets")) { @@ -241,16 +245,16 @@ class NetworkUtils { String netParams = utils.getNodeXml(requestInput, "network-params", false).replace("tag0:","").replace(":tag0","") networkParams = buildParams(netParams) } - + String networkStackId = utils.getNodeText1(queryIdResponse, "heat-stack-id") if (networkStackId == 'null' || networkStackId == "" || networkStackId == null) { networkStackId = "force_update" } - + String physicalNetworkName = utils.getNodeText1(queryIdResponse, "physical-network-name") String vlansCollection = buildVlans(queryIdResponse) - - updateNetworkRequest = + + updateNetworkRequest = """ ${cloudRegion} ${tenantId} @@ -276,7 +280,7 @@ class NetworkUtils { true ${backoutOnFailure} ${failIfExists} - ${networkParams} + ${networkParams} ${requestId} @@ -285,10 +289,10 @@ class NetworkUtils { ${messageId} """.trim() - + } return updateNetworkRequest - + } /** @@ -331,7 +335,7 @@ class NetworkUtils { ${vnfType} Pending - ${modelCustomizationId} + ${modelCustomizationId} tenant @@ -353,9 +357,9 @@ class NetworkUtils { return requestPayload } - + def String createCloudRegionVolumeRequest(groupId, volumeName, vnfType, vnfId, tenantId, cloudRegion, namespace, modelCustomizationId) { - + String requestPayload = """ ${groupId} @@ -363,7 +367,7 @@ class NetworkUtils { ${vnfType} Pending - ${modelCustomizationId} + ${modelCustomizationId} generic-vnf @@ -389,7 +393,7 @@ class NetworkUtils { """ - + return requestPayload } @@ -420,7 +424,7 @@ class NetworkUtils { ${vnfType} Active ${resourceVersion} - ${modelCustomizationId} + ${modelCustomizationId} ${relationshipList} """ } @@ -480,7 +484,7 @@ class NetworkUtils { } else { createNetworkContrailResponse = utils.getNodeXml(createNetworkResponse, "updateNetworkContrailResponse", false).replace("tag0:","").replace(":tag0","") } - + // rebuild network def networkList = ["network-id", "network-name", "network-type", "network-role", "network-technology", "neutron-network-id", "is-bound-to-vpn", "service-id", "network-role-instance", "resource-version", "resource-model-uuid", "orchestration-status", "heat-stack-id", "mso-catalog-key", "contrail-network-fqdn", "physical-network-name", "is-provider-network", "is-shared-network", "is-external-network"] @@ -495,10 +499,14 @@ class NetworkUtils { // rebuild 'segmentation-assignments' def rebuildSegmentationAssignments = "" if (utils.nodeExists(requeryIdAAIResponse, 'segmentation-assignments')) { - List elementList = ["segmentation-id"] - rebuildSegmentationAssignments = buildXMLElements(requeryIdAAIResponse, "", "segmentation-assignments", elementList) + List elementList = ["segmentation-id", "resource-version"] + if (utils.nodeExists(requeryIdAAIResponse, 'segmentation-assignment')) { // new tag + rebuildSegmentationAssignments = buildXMLElements(requeryIdAAIResponse, "segmentation-assignments", "segmentation-assignment", elementList) + } else { + rebuildSegmentationAssignments = buildXMLElements(requeryIdAAIResponse, "", "segmentation-assignments", elementList) + } } - + // rebuild 'ctag-assignments' / rebuildCtagAssignments def rebuildCtagAssignmentsList = "" if (utils.nodeExists(requeryIdAAIResponse, 'ctag-assignment')) { @@ -538,8 +546,8 @@ class NetworkUtils { return contrailNetworkCreatedUpdate } - - + + /** * This method returns the value for the name paramName. * Ex: @@ -594,20 +602,20 @@ class NetworkUtils { /** * This method returns the networkParams xml string. - * Ex: input: + * Ex: input: * * 1 * 0 * - * + * * Sample result: * * 1 * 0 * - * + * */ - + def buildParams(networkParams) { def build = "" def netParams = new XmlParser().parseText(networkParams) @@ -621,15 +629,15 @@ class NetworkUtils { build += "<${name}>${value}" } build += "" - } - + } + } catch (Exception ex) { println ' buildParams error - ' + ex.getMessage() build = "" - } + } return build } - + def getVlans(xmlInput) { def rtn = "" if (xmlInput!=null) { @@ -751,7 +759,7 @@ class NetworkUtils { } return rtn } - + /** * similar to network policymethod * @param xmlInput the XML document @@ -775,7 +783,6 @@ class NetworkUtils { } else { rtn.add(relatedLink.substring(relatedLink.indexOf("/generic-vnf/")+13, relatedLink.length())) } - } } } @@ -783,7 +790,7 @@ class NetworkUtils { } return rtn } - + /** * similar to network policymethod * @param xmlInput the XML document @@ -807,7 +814,6 @@ class NetworkUtils { } else { rtn.add(relatedLink.substring(relatedLink.indexOf("/l3-network/")+12, relatedLink.length())) } - } } } @@ -815,7 +821,7 @@ class NetworkUtils { } return rtn } - + def isVfRelationshipExist(xmlInput) { Boolean rtn = false if (xmlInput!=null) { @@ -824,7 +830,7 @@ class NetworkUtils { if (relationshipListSize > 0) { for (i in 0..relationshipListSize-1) { def relationshipXml = XmlUtil.serialize(relationshipList[i]) - if (utils.getNodeText(relationshipXml, 'related-to') == "vf-module") { + if (utils.getNodeText(relationshipXml, 'related-to') == "vf-module") { rtn = true } } @@ -856,7 +862,7 @@ class NetworkUtils { } return lcpCloudRegion } - + def getTenantId(xmlInput) { String tenantId = "" if (xmlInput!=null) { @@ -879,27 +885,27 @@ class NetworkUtils { } return tenantId } - + def isInstanceValueMatch(linkResource, globalSubscriberId, serviceType) { Boolean rtn = false try { String globalSubscriberIdLink = linkResource.substring(linkResource.indexOf("/customer/")+10, linkResource.indexOf("/service-subscriptions")) String serviceTypeLink = linkResource.substring(linkResource.indexOf("/service-subscription/")+22, linkResource.indexOf("/service-instances")) - if (globalSubscriberIdLink == globalSubscriberId) { + if (globalSubscriberIdLink == globalSubscriberId) { rtn = true } else { if (serviceTypeLink == serviceType) { rtn = true } } - + } catch (Exception ex) { println 'Exception - ' + ex.getMessage() return false } return rtn } - + def getListWithElements(xmlInput, groupName) { def rtn = "" if (xmlInput != null) { @@ -953,7 +959,6 @@ class NetworkUtils { xmlNetwork += "<"+element+">"+"Active"+"" } } - if (element=="heat-stack-id") { if (replaceNetworkId != "") { xmlNetwork += "<"+element+">"+replaceNetworkId+"" @@ -984,7 +989,6 @@ class NetworkUtils { } } } - } return xmlNetwork } @@ -1008,7 +1012,7 @@ class NetworkUtils { } else { def subnetList = ["subnet-id", "neutron-subnet-id", "gateway-address", "network-start-address", "cidr-mask", "ip-version", "orchestration-status", "dhcp-enabled", "dhcp-start", "dhcp-end", "resource-version", "subnet-name"] rebuildingSubnets += buildSubNetworkElements(subnetXml, createNetworkResponse, subnetList, "subnet") - } + } } if (utils.nodeExists(subnetsData, 'relationship')) { rebuildingSubnets = rebuildRelationship(requeryIdAAIResponse) @@ -1040,7 +1044,8 @@ class NetworkUtils { def subnetList = ["dhcp-start", "dhcp-end", "network-start-address", "cidr-mask", "dhcp-enabled", "gateway-address", "ip-version", "subnet-id", "subnet-name"] rebuildingSubnets += buildSubNetworkElements(subnetXml, subnetList, "subnets") //rebuildingSubnets += buildSubNetworkElements(subnetXml, subnetList, "") - } } + } + } } catch (Exception ex) { // } finally { @@ -1062,7 +1067,7 @@ class NetworkUtils { def xml= new XmlSlurper().parseText(subnetXml) var = xml.'**'.find {it.name() == element} if (var != null) { - if (element=="orchestration-status") { + if (element=="orchestration-status") { if(var.toString() == 'pending-create' || var.toString() == 'PendingCreate') { xmlBuild += "<"+element+">"+"Created"+"" } else { // pending-update or PendingUpdate' @@ -1136,7 +1141,8 @@ class NetworkUtils { xmlBuild += ""+var.toString()+"" } if (element == "ip-version") { - xmlBuild += ""+var.toString()+"" + String ipVersion = getIpvVersion(var.toString()) + xmlBuild += ""+ipVersion+"" } if (element == "subnet-id") { xmlBuild += ""+var.toString()+"" @@ -1219,7 +1225,7 @@ class NetworkUtils { } return rebuildingSubnets } - + def buildVlans(queryIdResponse) { def rebuildingSubnets = "" def subnetsData = new XmlSlurper().parseText(queryIdResponse) @@ -1230,7 +1236,7 @@ class NetworkUtils { for (i in 0..subnetsSize-1) { def subnet = subnets[i] def subnetXml = XmlUtil.serialize(subnet) - + String vlan = utils.getNodeText1(subnetXml, "segmentation-id") if (i>0){ rebuildingSubnets += "," @@ -1465,7 +1471,7 @@ class NetworkUtils { } public boolean isRollbackEnabled (Execution execution, String payloadXml) { - + def rollbackEnabled = false def rollbackValueSet = false if (utils.nodeExists(payloadXml, "backout-on-failure")) { @@ -1480,12 +1486,31 @@ class NetworkUtils { rollbackValueSet = true; } } - + if (!rollbackValueSet) { if (execution.getVariable("URN_mso_rollback") != null) { rollbackEnabled = execution.getVariable("URN_mso_rollback").toBoolean() - } + } } return rollbackEnabled } + + + /** + * This method extracts the version for the the given ip-version. + * + * @param String ipvVersion - IP protocols version (ex: ipv4 or ipv6) + * @return String version - digit version (ex: 4 or 6) + */ + + public String getIpvVersion (String ipvVersion) { + + String version = "" + if (ipvVersion.isNumber()) { + version = ipvVersion + } else { + version = ipvVersion.substring(ipvVersion.indexOf("ipv")+3) + } + return version + } } diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/RainyDayHandler.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/RainyDayHandler.groovy new file mode 100644 index 0000000000..8f0570036e --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/RainyDayHandler.groovy @@ -0,0 +1,169 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common.scripts; + +import static org.apache.commons.lang3.StringUtils.*; + + + +import org.apache.commons.lang3.* +import org.camunda.bpm.engine.delegate.BpmnError +import org.camunda.bpm.engine.runtime.Execution +import org.json.JSONObject; +import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor +import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil +import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition +import org.openecomp.mso.bpmn.core.json.JsonUtils +import org.openecomp.mso.client.policy.PolicyDecision +import org.openecomp.mso.client.policy.PolicyRestClient + + +import com.att.ecomp.mso.bpmn.core.domain.* + +import groovy.json.* + +/** + * This groovy class supports the RainyDayHandler.bpmn process. + * + * @author + * + * Inputs: + * @param - msoRequestId + * @param - isDebugLogEnabled + * @param - serviceType + * @param - vnfType + * @param - currentActivity + * @param - workStep + * @param - failedActivity + * @param - errorCode + * @param - errorText + * + * Outputs: + * @param - WorkflowException + * @param - handlingCode + * + */ +public class RainyDayHandler extends AbstractServiceTaskProcessor { + + String Prefix="RDH_" + ExceptionUtil exceptionUtil = new ExceptionUtil() + + JsonUtils jsonUtils = new JsonUtils() + + public void preProcessRequest (Execution execution) { + def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** preProcessRequest of RainyDayHandler *****", isDebugLogEnabled) + + try { + execution.setVariable("prefix", Prefix) + // check for required input + String requestId = execution.getVariable("msoRequestId") + utils.log("DEBUG", "msoRequestId is: " + requestId, isDebugLogEnabled) + def serviceType = execution.getVariable("serviceType") + utils.log("DEBUG", "serviceType is: " + serviceType, isDebugLogEnabled) + def vnfType = execution.getVariable("vnfType") + utils.log("DEBUG", "vnftype is: " + vnfType, isDebugLogEnabled) + def currentActivity = execution.getVariable("currentActivity") + utils.log("DEBUG", "currentActivity is: " + currentActivity, isDebugLogEnabled) + def workStep = execution.getVariable("workStep") + utils.log("DEBUG", "workStep is: " + workStep, isDebugLogEnabled) + def failedActivity = execution.getVariable("failedActivity") + utils.log("DEBUG", "failedActivity is: " + failedActivity, isDebugLogEnabled) + def errorCode = execution.getVariable("errorCode") + utils.log("DEBUG", "errorCode is: " + errorCode, isDebugLogEnabled) + def errorText = execution.getVariable("errorText") + utils.log("DEBUG", "errorText is: " + errorText, isDebugLogEnabled) + + } catch (BpmnError e) { + throw e; + } catch (Exception ex){ + msg = "Exception in preProcessRequest " + ex.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit preProcessRequest of RainyDayHandler *****", isDebugLogEnabled) + } + + public void queryPolicy (Execution execution) { + def isDebugLogEnabled = execution.getVariable("isDebugLogEnabled") + String msg = "" + utils.log("DEBUG"," ***** queryPolicy of RainyDayHandler *****", isDebugLogEnabled) + + try { + + // check for input + String serviceType = execution.getVariable("serviceType") + String vnfType = execution.getVariable("vnfType") + + utils.log("DEBUG", "serviceType: " + serviceType, isDebugLogEnabled) + utils.log("DEBUG", "vnfType: " + vnfType, isDebugLogEnabled) + + def errorCode = execution.getVariable("errorCode") + def bbId = execution.getVariable("currentActivity") + def workStep = execution.getVariable("workStep") + + utils.log("DEBUG", "Before querying policy", isDebugLogEnabled) + + PolicyDecision decisionObject = null + + try { + PolicyRestClient policyClient = new PolicyRestClient() + utils.log("DEBUG", "Created policy client", isDebugLogEnabled) + decisionObject = policyClient.getDecision(serviceType, vnfType, bbId, workStep, errorCode) + utils.log("DEBUG", "Obtained decision object", isDebugLogEnabled) + } catch(Exception e) { + msg = "Exception in queryPolicy " + e.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + + } + + String decision = 'DENY' + String disposition = "Abort" + if (decisionObject != null) { + decision = decisionObject.getDecision() + disposition = decisionObject.getDetails() + utils.log("DEBUG", "Obtained disposition from policy engine: " + disposition, isDebugLogEnabled) + } + else { + disposition = "Manual" + } + if (disposition == null) { + disposition = "Manual" + } + execution.setVariable("handlingCode", disposition) + execution.setVariable("validResponses", "rollback, abort, skip, retry") + utils.log("DEBUG", "Disposition: "+ disposition, isDebugLogEnabled) + + } catch (BpmnError e) { + utils.log("DEBUG", "BPMN exception: " + e.errorMessage, isDebugLogEnabled) + throw e; + } catch (Exception ex){ + msg = "Exception in queryPolicy " + ex.getMessage() + utils.log("DEBUG", msg, isDebugLogEnabled) + //exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + utils.log("DEBUG"," ***** Exit queryPolicy of RainyDayHandler *****", isDebugLogEnabled) + } + + + + +} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapter.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapter.groovy index 0f05a6b82c..d37e889f21 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapter.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapter.groovy @@ -50,7 +50,8 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor { execution.setVariable("asynchronousResponseTimeout", false) execution.setVariable("continueListening", false) execution.setVariable("SDNCA_SuccessIndicator", false) - + execution.setVariable("SDNCA_InterimNotify", false) + // Authorization Info String basicAuthValue = execution.getVariable("URN_mso_adapters_po_auth") utils.log("DEBUG", "Obtained BasicAuth userid password for sdnc adapter:" + basicAuthValue, isDebugEnabled) @@ -145,8 +146,8 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor { utils.logAudit("Outgoing SDNCAdapterRequest:\n" + sdncAdapterRequest) execution.setVariable("sdncAdapterRequest", sdncAdapterRequest) - utils.log("DEBUG", execution.getVariable("sdncAdapterRequest"), isDebugEnabled) - utils.log("DEBUG", execution.getVariable("URN_mso_adapters_sdnc_endpoint"), isDebugEnabled) + utils.log("DEBUG", execution.getVariable("sdncAdapterRequest"), isDebugEnabled) + utils.log("DEBUG", execution.getVariable("URN_mso_adapters_sdnc_endpoint"), isDebugEnabled) }catch(Exception e){ utils.log("DEBUG", 'Internal Error occured during PreProcess Method: ' + e, isDebugEnabled) exceptionUtil.buildAndThrowWorkflowException(execution, 9999, 'Internal Error occured during PreProcess Method') // TODO: what message and error code? @@ -178,7 +179,7 @@ public class SDNCAdapter extends AbstractServiceTaskProcessor { utils.log("DEBUG","DECODED SDNCCallback RequestData is:\n" + callbackRequestData, isDebugEnabled) String sdncAdapterWorkflowResponse =""" - + ${callbackHeader} ${callbackRequestData} diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtils.groovy index 4ca0370185..cd5828e14f 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/SDNCAdapterUtils.groovy @@ -438,6 +438,15 @@ class SDNCAdapterUtils { public String sdncTopologyRequestV2 (Execution execution, String requestXML, String serviceInstanceId, String callbackUrl, String action, String requestAction, String cloudRegionId, networkId, String queryAAIResponse, String additionalData) { def utils=new MsoUtils() + // SNDC is expecting request Id for header as unique each call. + String hdrRequestId = "" + String testHdrRequestId = execution.getVariable("testMessageId") // for test purposes. + if (testHdrRequestId == null) { + hdrRequestId = UUID.randomUUID() // generate unique + } else { + hdrRequestId = testHdrRequestId + } + String requestId = "" try { requestId = execution.getVariable("mso-request-id") @@ -457,7 +466,7 @@ class SDNCAdapterUtils { // Replace/Use the value of network-type from aai query (vs input) during Delete Network flows. if (queryAAIResponse != null) { - networkType = utils.getNodeText1(queryAAIResponse, "network-type") + networkType = utils.getNodeText1(queryAAIResponse, "network-type") } String serviceId = "" @@ -486,17 +495,17 @@ class SDNCAdapterUtils { // get subscriber name int subscriberNameStart = siRelatedLink.indexOf("customers/customer/") int subscriberNameEnd = siRelatedLink.indexOf("/service-subscriptions/") - subscriberName = siRelatedLink.substring(subscriberNameStart + 19, subscriberNameEnd) + subscriberName = siRelatedLink.substring(subscriberNameStart + 19, subscriberNameEnd) subscriberName = UriUtils.decode(subscriberName,"UTF-8") } String content = - """ + """ - ${requestId} + ${hdrRequestId} ${serviceInstanceId} ${action} network-topology-operation @@ -551,22 +560,21 @@ class SDNCAdapterUtils { String hdrRequestId = "" String testHdrRequestId = execution.getVariable("testMessageId") // for test purposes. if (testHdrRequestId == null) { - hdrRequestId = UUID.randomUUID() // generate unique + hdrRequestId = UUID.randomUUID() // generate unique } else { - hdrRequestId = testHdrRequestId + hdrRequestId = testHdrRequestId } String requestId = "" String testRequestId = execution.getVariable("testMessageId") // for test purposes. if (testRequestId == null) { - try { - requestId = execution.getVariable("mso-request-id") - } catch (Exception ex) { - requestId = utils.getNodeText1(requestXML, "request-id") - } + requestId = execution.getVariable("mso-request-id") + if (requestId == null) { + requestId = execution.getVariable("msoRequestId") + } } else { - requestId = testRequestId - } + requestId = testRequestId + } String aicCloudRegion = cloudRegionId String tenantId = "" @@ -621,32 +629,32 @@ class SDNCAdapterUtils { // network-information from 'networkModelInfo' // verify the DB Catalog response String networkModelInfo = utils.getNodeXml(requestXML, "networkModelInfo", false).replace("tag0:","").replace(":tag0","") String modelInvariantUuid = utils.getNodeText1(networkModelInfo, "modelInvariantUuid") !=null ? - utils.getNodeText1(networkModelInfo, "modelInvariantUuid") : "" + utils.getNodeText1(networkModelInfo, "modelInvariantUuid") : "" String modelCustomizationUuid = utils.getNodeText1(networkModelInfo, "modelCustomizationUuid") !=null ? - utils.getNodeText1(networkModelInfo, "modelCustomizationUuid") : "" + utils.getNodeText1(networkModelInfo, "modelCustomizationUuid") : "" String modelUuid = utils.getNodeText1(networkModelInfo, "modelUuid") !=null ? - utils.getNodeText1(networkModelInfo, "modelUuid") : "" + utils.getNodeText1(networkModelInfo, "modelUuid") : "" String modelVersion = utils.getNodeText1(networkModelInfo, "modelVersion") !=null ? - utils.getNodeText1(networkModelInfo, "modelVersion") : "" + utils.getNodeText1(networkModelInfo, "modelVersion") : "" String modelName = utils.getNodeText1(networkModelInfo, "modelName") !=null ? - utils.getNodeText1(networkModelInfo, "modelName") : "" + utils.getNodeText1(networkModelInfo, "modelName") : "" // service-information from 'networkModelInfo' // verify the DB Catalog response String serviceModelInfo = utils.getNodeXml(requestXML, "serviceModelInfo", false).replace("tag0:","").replace(":tag0","") String serviceModelInvariantUuid = utils.getNodeText1(serviceModelInfo, "modelInvariantUuid") !=null ? - utils.getNodeText1(serviceModelInfo, "modelInvariantUuid") : "" + utils.getNodeText1(serviceModelInfo, "modelInvariantUuid") : "" String serviceModelUuid = utils.getNodeText1(serviceModelInfo, "modelUuid") !=null ? - utils.getNodeText1(serviceModelInfo, "modelUuid") : "" + utils.getNodeText1(serviceModelInfo, "modelUuid") : "" String serviceModelVersion = utils.getNodeText1(serviceModelInfo, "modelVersion") !=null ? - utils.getNodeText1(serviceModelInfo, "modelVersion") : "" + utils.getNodeText1(serviceModelInfo, "modelVersion") : "" String serviceModelName = utils.getNodeText1(serviceModelInfo, "modelName") !=null ? - utils.getNodeText1(serviceModelInfo, "modelName") : "" + utils.getNodeText1(serviceModelInfo, "modelName") : "" String content = - """ + """ ${hdrRequestId} ${serviceInstanceId} @@ -774,8 +782,9 @@ class SDNCAdapterUtils { } try{ - // if a response code is 0 or 200 then Success - if (requestDataResponseCode == 200 || requestDataResponseCode == 0) { + execution.setVariable(prefix+'sdncRequestDataResponseCode', requestDataResponseCode.toString()) + // if a response code is 0 or 2XX then Success + if ((requestDataResponseCode >= 200 && requestDataResponseCode <= 299) || requestDataResponseCode == 0) { execution.setVariable(prefix+'sdncResponseSuccess', true) taskProcessor.utils.log("DEBUG", "Setting sdncResponseSuccess to True ", isDebugLogEnabled) taskProcessor.utils.log("DEBUG", "Exited ValidateSDNCResponse Method", isDebugLogEnabled) @@ -892,7 +901,7 @@ class SDNCAdapterUtils { taskProcessor.utils.log("DEBUG", "intDataResponseCode " + intDataResponseCode , isDebugLogEnabled) // if response-code is not Success (200, 201, etc) we need to throw an exception - if (intDataResponseCode != 200 && intDataResponseCode != 0) { + if ((intDataResponseCode < 200 || intDataResponseCode > 299) && intDataResponseCode != 0) { execution.setVariable(prefix+'ResponseCode', intDataResponseCode) execution.setVariable("L3HLAB_rollback", true) def msg = trinityExceptionUtil.mapSDNCAdapterExceptionToErrorResponse(response, execution) @@ -927,29 +936,32 @@ class SDNCAdapterUtils { } public String modelInfoToEcompModelInformation(String jsonModelInfo) { - String modelInvariantId = jsonUtil.getJsonValue(jsonModelInfo, "modelInvariantId") - String modelVersionId = jsonUtil.getJsonValue(jsonModelInfo, "modelVersionId") - if (modelVersionId == null) { - modelVersionId = "" + String modelInvariantUuid = jsonUtil.getJsonValue(jsonModelInfo, "modelInvariantUuid") + String modelUuid = jsonUtil.getJsonValue(jsonModelInfo, "modelUuid") + if (modelUuid == null) { + modelUuid = "" } String modelCustomizationUuid = jsonUtil.getJsonValue(jsonModelInfo, "modelCustomizationUuid") String modelCustomizationString = "" if (modelCustomizationUuid != null) { modelCustomizationString = "${modelCustomizationUuid}" - } + } String modelVersion = jsonUtil.getJsonValue(jsonModelInfo, "modelVersion") + if (modelVersion == null) { + modelVersion = "" + } String modelName = jsonUtil.getJsonValue(jsonModelInfo, "modelName") String ecompModelInformation = """ - ${modelInvariantId} - ${modelVersionId} + ${modelInvariantUuid} + ${modelUuid} ${modelCustomizationString} ${modelVersion} ${modelName} """ - return ecompModelInformation - } + return ecompModelInformation + } /** * Decode XML - replace & < and > with '&', '<' and '>' diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VfModuleBase.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VfModuleBase.groovy index 7a97d5cd12..e0393cb206 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VfModuleBase.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VfModuleBase.groovy @@ -501,6 +501,319 @@ public abstract class VfModuleBase extends AbstractServiceTaskProcessor { return vfModuleParams } + + + /* + * Parses VNF parameters passed in on the incoming requests and SDNC parameters returned from SDNC get response + * for both VNF and VF Module + * and puts them into the format expected by VNF adapter. + * @param vnfParamsMap - map of VNF parameters passed in the request body + * @param vnfSdncGetResponse - response string from SDNC GET VNF topology request + * @param vfmoduleSdncGetResponse - response string from SDNC GET VF Module topology request + * @param vnfId + * @param vnfName + * @param vfModuleId + * @param vfModuleName + * @param vfModuleIndex - can be null + * @return a String of key/value entries for vfModuleParams + */ + + protected String buildVfModuleParamsFromCombinedTopologies(Map vnfParamsMap, String vnfSdncGetResponse, String vfmoduleSdncGetResponse, String vnfId, String vnfName, + String vfModuleId, String vfModuleName, String vfModuleIndex) { + + // Set up initial parameters + + Map paramsMap = new HashMap() + + if (vfModuleIndex != null) { + paramsMap.put("vf_module_index", "${vfModuleIndex}") + } + + // Add-on data + paramsMap.put("vnf_id", "${vnfId}") + paramsMap.put("vnf_name", "${vnfName}") + paramsMap.put("vf_module_id", "${vfModuleId}") + paramsMap.put("vf_module_name", "${vfModuleName}") + + //Get SDNC Response Data for VNF + + String vnfData = utils.getNodeXml(vnfSdncGetResponse, "response-data") + vnfData = vnfData.replaceAll("<", "<") + vnfData = vnfData.replaceAll(">", ">") + + String vnfTopology = utils.getNodeXml(vnfData, "vnf-topology") + vnfTopology = utils.removeXmlPreamble(vnfTopology) + vnfTopology = utils.removeXmlNamespaces(vnfTopology) + + InputSource sourceVnf = new InputSource(new StringReader(vnfData)); + DocumentBuilderFactory docFactoryVnf = DocumentBuilderFactory.newInstance(); + docFactoryVnf.setNamespaceAware(true) + DocumentBuilder docBuilderVnf = docFactoryVnf.newDocumentBuilder() + Document responseXmlVnf = docBuilderVnf.parse(sourceVnf) + + // Availability Zones Data + + NodeList aZonesList = responseXmlVnf.getElementsByTagNameNS("*", "availability-zones") + String aZonePosition = "0" + for (int z = 0; z < aZonesList.getLength(); z++) { + Node node = aZonesList.item(z) + if (node.getNodeType() == Node.ELEMENT_NODE) { + Element eElement = (Element) node + String aZoneValue = utils.getElementText(eElement, "availability-zone") + aZonePosition = z.toString() + paramsMap.put("availability_zone_${aZonePosition}", "${aZoneValue}") + } + } + + // VNF Networks Data + + StringBuilder sbNet = new StringBuilder() + + NodeList vnfNetworkList = responseXmlVnf.getElementsByTagNameNS("*", "vnf-networks") + for (int x = 0; x < vnfNetworkList.getLength(); x++) { + Node node = vnfNetworkList.item(x) + if (node.getNodeType() == Node.ELEMENT_NODE) { + Element eElement = (Element) node + String vnfNetworkKey = utils.getElementText(eElement, "network-role") + String vnfNetworkNeutronIdValue = utils.getElementText(eElement, "neutron-id") + String vnfNetworkNetNameValue = utils.getElementText(eElement, "network-name") + String vnfNetworkSubNetIdValue = utils.getElementText(eElement, "subnet-id") + String vnfNetworkV6SubNetIdValue = utils.getElementText(eElement, "ipv6-subnet-id") + String vnfNetworkNetFqdnValue = utils.getElementText(eElement, "contrail-network-fqdn") + paramsMap.put("${vnfNetworkKey}_net_id", "${vnfNetworkNeutronIdValue}") + paramsMap.put("${vnfNetworkKey}_net_name", "${vnfNetworkNetNameValue}") + paramsMap.put("${vnfNetworkKey}_subnet_id", "${vnfNetworkSubNetIdValue}") + paramsMap.put("${vnfNetworkKey}_v6_subnet_id", "${vnfNetworkV6SubNetIdValue}") + paramsMap.put("${vnfNetworkKey}_net_fqdn", "${vnfNetworkNetFqdnValue}") + + NodeList sriovVlanFilterList = eElement.getElementsByTagNameNS("*","sriov-vlan-filter-list") + StringBuffer sriovFilterBuf = new StringBuffer() + String values = "" + for(int i = 0; i < sriovVlanFilterList.getLength(); i++){ + Node node1 = sriovVlanFilterList.item(i) + if (node1.getNodeType() == Node.ELEMENT_NODE) { + Element eElement1 = (Element) node1 + String value = utils.getElementText(eElement1, "sriov-vlan-filter") + if (i != sriovVlanFilterList.getLength() - 1) { + values = sriovFilterBuf.append(value + ",") + } + else { + values = sriovFilterBuf.append(value); + } + } + } + if (!values.isEmpty()) { + paramsMap.put("${vnfNetworkKey}_ATT_VF_VLAN_FILTER", "${values}") + } + } + } + + //Get SDNC Response Data for VF Module + + String vfModuleData = utils.getNodeXml(vfmoduleSdncGetResponse, "response-data") + vfModuleData = vfModuleData.replaceAll("<", "<") + vfModuleData = vfModuleData.replaceAll(">", ">") + + String vfModuleTopology = utils.getNodeXml(vfModuleData, "vf-module-topology") + vfModuleTopology = utils.removeXmlPreamble(vfModuleTopology) + vfModuleTopology = utils.removeXmlNamespaces(vfModuleTopology) + String vfModuleTopologyIdentifier = utils.getNodeXml(vfModuleTopology, "vf-module-topology-identifier") + + InputSource sourceVfModule = new InputSource(new StringReader(vfModuleData)); + DocumentBuilderFactory docFactoryVfModule = DocumentBuilderFactory.newInstance(); + docFactoryVfModule.setNamespaceAware(true) + DocumentBuilder docBuilderVfModule = docFactoryVfModule.newDocumentBuilder() + Document responseXmlVfModule = docBuilderVfModule.parse(sourceVfModule) + + // VMS Data + + def key + def value + def networkKey + def networkValue + def floatingIPKey + def floatingIPKeyValue + def floatingIPV6Key + def floatingIPV6KeyValue + StringBuilder sb = new StringBuilder() + + NodeList vmsList = responseXmlVfModule.getElementsByTagNameNS("*","vm") + for (int x = 0; x < vmsList.getLength(); x++) { + Node node = vmsList.item(x) + if (node.getNodeType() == Node.ELEMENT_NODE) { + Element eElement = (Element) node + key = utils.getElementText(eElement, "vm-type") + String values + String position = "0" + StringBuilder sb1 = new StringBuilder() + NodeList valueList = eElement.getElementsByTagNameNS("*","vm-names") + NodeList vmNetworksList = eElement.getElementsByTagNameNS("*","vm-networks") + for(int i = 0; i < valueList.getLength(); i++){ + Node node1 = valueList.item(i) + if (node1.getNodeType() == Node.ELEMENT_NODE) { + Element eElement1 = (Element) node1 + value = utils.getElementText(eElement1, "vm-name") + if (i != valueList.getLength() - 1) { + values = sb1.append(value + ",") + } + else { + values = sb1.append(value); + } + position = i.toString() + paramsMap.put("${key}_name_${position}", "${value}") + } + } + for(int n = 0; n < vmNetworksList.getLength(); n++){ + String floatingIpKeyValueStr = "" + String floatingIpV6KeyValueStr = "" + Node nodeNetworkKey = vmNetworksList.item(n) + if (nodeNetworkKey.getNodeType() == Node.ELEMENT_NODE) { + Element eElementNetworkKey = (Element) nodeNetworkKey + String ipAddressValues + String ipV6AddressValues + String networkPosition = "0" + StringBuilder sb2 = new StringBuilder() + StringBuilder sb3 = new StringBuilder() + StringBuilder sb4 = new StringBuilder() + networkKey = utils.getElementText(eElementNetworkKey, "network-role") + floatingIPKey = key + '_' + networkKey + '_floating_ip' + floatingIPKeyValue = utils.getElementText(eElementNetworkKey, "floating-ip") + if(!floatingIPKeyValue.isEmpty()){ + paramsMap.put("$floatingIPKey", "$floatingIPKeyValue") + } + floatingIPV6Key = key + '_' + networkKey + '_floating_v6_ip' + floatingIPV6KeyValue = utils.getElementText(eElementNetworkKey, "floating-ip-v6") + if(!floatingIPV6KeyValue.isEmpty()){ + paramsMap.put("$floatingIPV6Key", "$floatingIPV6KeyValue") + } + NodeList networkIpsList = eElementNetworkKey.getElementsByTagNameNS("*","network-ips") + for(int a = 0; a < networkIpsList.getLength(); a++){ + Node ipAddress = networkIpsList.item(a) + if (ipAddress.getNodeType() == Node.ELEMENT_NODE) { + Element eElementIpAddress = (Element) ipAddress + String ipAddressValue = utils.getElementText(eElementIpAddress, "ip-address") + if (a != networkIpsList.getLength() - 1) { + ipAddressValues = sb2.append(ipAddressValue + ",") + } + else { + ipAddressValues = sb2.append(ipAddressValue); + } + networkPosition = a.toString() + paramsMap.put("${key}_${networkKey}_ip_${networkPosition}", "${ipAddressValue}") + } + } + + paramsMap.put("${key}_${networkKey}_ips", "${ipAddressValues}") + + NodeList interfaceRoutePrefixesList = eElementNetworkKey.getElementsByTagNameNS("*","interface-route-prefixes") + String interfaceRoutePrefixValues = sb3.append("[") + + for(int a = 0; a < interfaceRoutePrefixesList.getLength(); a++){ + Node interfaceRoutePrefix = interfaceRoutePrefixesList.item(a) + if (interfaceRoutePrefix.getNodeType() == Node.ELEMENT_NODE) { + Element eElementInterfaceRoutePrefix = (Element) interfaceRoutePrefix + String interfaceRoutePrefixValue = utils.getElementText(eElementInterfaceRoutePrefix, "interface-route-prefix-cidr") + if (interfaceRoutePrefixValue == null || interfaceRoutePrefixValue.isEmpty()) { + interfaceRoutePrefixValue = utils.getElementText(eElementInterfaceRoutePrefix, "interface-route-prefix") + } + if (a != interfaceRoutePrefixesList.getLength() - 1) { + interfaceRoutePrefixValues = sb3.append("{\"interface_route_table_routes_route_prefix\": \"" + interfaceRoutePrefixValue + "\"}" + ",") + } + else { + interfaceRoutePrefixValues = sb3.append("{\"interface_route_table_routes_route_prefix\": \"" + interfaceRoutePrefixValue + "\"}") + } + } + } + interfaceRoutePrefixValues = sb3.append("]") + if (interfaceRoutePrefixesList.getLength() > 0) { + paramsMap.put("${key}_${networkKey}_route_prefixes", "${interfaceRoutePrefixValues}") + } + + NodeList networkIpsV6List = eElementNetworkKey.getElementsByTagNameNS("*","network-ips-v6") + for(int a = 0; a < networkIpsV6List.getLength(); a++){ + Node ipV6Address = networkIpsV6List.item(a) + if (ipV6Address.getNodeType() == Node.ELEMENT_NODE) { + Element eElementIpV6Address = (Element) ipV6Address + String ipV6AddressValue = utils.getElementText(eElementIpV6Address, "ip-address-ipv6") + if (a != networkIpsV6List.getLength() - 1) { + ipV6AddressValues = sb4.append(ipV6AddressValue + ",") + } + else { + ipV6AddressValues = sb4.append(ipV6AddressValue); + } + networkPosition = a.toString() + paramsMap.put("${key}_${networkKey}_v6_ip_${networkPosition}", "${ipV6AddressValue}") + } + } + paramsMap.put("${key}_${networkKey}_v6_ips", "${ipV6AddressValues}") + } + } + paramsMap.put("${key}_names", "${values}") + } + } + //SDNC Response Params + List sdncResponseParamsToSkip = ["vnf_id", "vf_module_id", "vnf_name", "vf_module_name"] + + String vnfParamsChildNodes = utils.getChildNodes(vnfData, "param") + if(vnfParamsChildNodes == null || vnfParamsChildNodes.length() < 1){ + // No SDNC params for VNF + }else{ + NodeList paramsList = responseXmlVnf.getElementsByTagNameNS("*", "param") + for (int z = 0; z < paramsList.getLength(); z++) { + Node node = paramsList.item(z) + Element eElement = (Element) node + String vnfParameterName = utils.getElementText(eElement, "name") + if (!sdncResponseParamsToSkip.contains(vnfParameterName)) { + String vnfParameterValue = utils.getElementText(eElement, "value") + paramsMap.put("${vnfParameterName}", "${vnfParameterValue}") + } + } + } + + String vfModuleParamsChildNodes = utils.getChildNodes(vfModuleData, "param") + if(vfModuleParamsChildNodes == null || vfModuleParamsChildNodes.length() < 1){ + // No SDNC params for VF Module + }else{ + NodeList paramsList = responseXmlVfModule.getElementsByTagNameNS("*", "param") + for (int z = 0; z < paramsList.getLength(); z++) { + Node node = paramsList.item(z) + Element eElement = (Element) node + String vnfParameterName = utils.getElementText(eElement, "name") + if (!sdncResponseParamsToSkip.contains(vnfParameterName)) { + String vnfParameterValue = utils.getElementText(eElement, "value") + paramsMap.put("${vnfParameterName}", "${vnfParameterValue}") + } + } + } + + // Parameters received from the request should overwrite any parameters received from SDNC + if (vnfParamsMap != null) { + for (Map.Entry entry : vnfParamsMap.entrySet()) { + String vnfKey = entry.getKey() + String vnfValue = entry.getValue() + paramsMap.put("$vnfKey", "$vnfValue") + } + } + + StringBuilder sbParams = new StringBuilder() + def vfModuleParams = "" + for (Map.Entry entry : paramsMap.entrySet()) { + String paramsXml + String paramName = entry.getKey() + String paramValue = entry.getValue() + paramsXml = + """ + ${paramName} + ${paramValue} + + """ + + vfModuleParams = sbParams.append(paramsXml) + } + + return vfModuleParams + + } /* diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtils.groovy index 022a00c192..7ae5821c59 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtils.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtils.groovy @@ -99,7 +99,7 @@ class VidUtils { asdcServiceModelVersion = it.relatedInstance.modelInfo?.modelVersion } if (it.relatedInstance.modelInfo?.modelType == 'vnf') { - modelCustomizationName = it.relatedInstance.modelInfo?.modelCustomizationName + modelCustomizationName = it.relatedInstance.modelInfo?.modelInstanceName } } @@ -110,7 +110,7 @@ class VidUtils { if(userParams != null) { userParamsNode = buildUserParams(userParams) } - def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationId ?: '' + def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationUuid ?: '' def xmlReq = """ @@ -205,6 +205,7 @@ class VidUtils { * @return * Note: See latest version: createXmlNetworkRequestInstance() */ + public String createXmlNetworkRequestInfra(execution, def networkJsonIncoming) { def requestId = execution.getVariable("requestId") @@ -216,6 +217,11 @@ class VidUtils { try { Map reqMap = jsonSlurper.parseText(networkJsonIncoming) def instanceName = reqMap.requestDetails.requestInfo.instanceName + def modelCustomizationId = reqMap.requestDetails.modelInfo.modelCustomizationId + if (modelCustomizationId == null) { + modelCustomizationId = reqMap.requestDetails.modelInfo.modelCustomizationUuid !=null ? + reqMap.requestDetails.modelInfo.modelCustomizationUuid : "" + } def modelName = reqMap.requestDetails.modelInfo.modelName def lcpCloudRegionId = reqMap.requestDetails.cloudConfiguration.lcpCloudRegionId def tenantId = reqMap.requestDetails.cloudConfiguration.tenantId @@ -253,6 +259,7 @@ class VidUtils { ${networkId} ${instanceName} ${modelName} + ${modelCustomizationId} ${lcpCloudRegionId} ${tenantId} ${serviceId} @@ -279,12 +286,11 @@ class VidUtils { */ public String createXmlNetworkRequestInstance(execution) { - def networkModelVersionId = "" + def networkModelUuid = "" def networkModelName = "" - def networkModelType = "" def networkModelVersion = "" - def networkModelCustomizationId = "" - def networkModelInvariantId = "" + def networkModelCustomizationUuid = "" + def networkModelInvariantUuid = "" // verify the DB Catalog response JSON structure def networkModelInfo = execution.getVariable("networkModelInfo") @@ -293,23 +299,20 @@ class VidUtils { try { Map modelMap = jsonSlurper.parseText(networkModelInfo) if (modelMap != null) { - if (networkModelInfo.contains("modelVersionId")) { - networkModelVersionId = modelMap.modelVersionId !=null ? modelMap.modelVersionId : "" + if (networkModelInfo.contains("modelUuid")) { + networkModelUuid = modelMap.modelUuid !=null ? modelMap.modelUuid : "" } if (networkModelInfo.contains("modelName")) { networkModelName = modelMap.modelName !=null ? modelMap.modelName : "" } - if (networkModelInfo.contains("modelType")) { - networkModelType = modelMap.modelType !=null ? modelMap.modelType : "" - } if (networkModelInfo.contains("modelVersion")) { networkModelVersion = modelMap.modelVersion !=null ? modelMap.modelVersion : "" } - if (networkModelInfo.contains("modelCustomizationId")) { - networkModelCustomizationId = modelMap.modelCustomizationId !=null ? modelMap.modelCustomizationId : "" + if (networkModelInfo.contains("modelCustomizationUuid")) { + networkModelCustomizationUuid = modelMap.modelCustomizationUuid !=null ? modelMap.modelCustomizationUuid : "" } - if (networkModelInfo.contains("modelInvariantId")) { - networkModelInvariantId = modelMap.modelInvariantId !=null ? modelMap.modelInvariantId : "" + if (networkModelInfo.contains("modelInvariantUuid")) { + networkModelInvariantUuid = modelMap.modelInvariantUuid !=null ? modelMap.modelInvariantUuid : "" } } } catch (Exception ex) { @@ -317,12 +320,11 @@ class VidUtils { } } - def serviceModelVersionId = "" + def serviceModelUuid = "" def serviceModelName = "" - def serviceModelType = "" def serviceModelVersion = "" - def serviceModelCustomizationId = "" - def serviceModelInvariantId = "" + def serviceModelCustomizationUuid = "" + def serviceModelInvariantUuid = "" // verify the DB Catalog response JSON structure def serviceModelInfo = execution.getVariable("serviceModelInfo") @@ -331,23 +333,20 @@ class VidUtils { try { Map modelMap = jsonServiceSlurper.parseText(serviceModelInfo) if (modelMap != null) { - if (serviceModelInfo.contains("modelVersionId")) { - serviceModelVersionId = modelMap.modelVersionId !=null ? modelMap.modelVersionId : "" + if (serviceModelInfo.contains("modelUuid")) { + serviceModelUuid = modelMap.modelUuid !=null ? modelMap.modelUuid : "" } if (serviceModelInfo.contains("modelName")) { serviceModelName = modelMap.modelName !=null ? modelMap.modelName : "" } - if (serviceModelInfo.contains("modelType")) { - serviceModelType = modelMap.modelType !=null ? modelMap.modelType : "" - } if (serviceModelInfo.contains("modelVersion")) { serviceModelVersion = modelMap.modelVersion !=null ? modelMap.modelVersion : "" } - if (serviceModelInfo.contains("modelCustomizationId")) { - serviceModelCustomizationId = modelMap.modelCustomizationId !=null ? modelMap.modelCustomizationId : "" + if (serviceModelInfo.contains("modelCustomizationUuid")) { + serviceModelCustomizationUuid = modelMap.modelCustomizationUuid !=null ? modelMap.modelCustomizationUuid : "" } - if (serviceModelInfo.contains("modelInvariantId")) { - serviceModelInvariantId = modelMap.modelInvariantId !=null ? modelMap.modelInvariantId : "" + if (serviceModelInfo.contains("modelInvariantUuid")) { + serviceModelInvariantUuid = modelMap.modelInvariantUuid !=null ? modelMap.modelInvariantUuid : "" } } } catch (Exception ex) { @@ -399,7 +398,7 @@ class VidUtils { ${networkId} ${networkName} - ${networkModelType} + ${networkModelName} ${subscriptionServiceType} ${globalSubscriberId} ${aicCloudReqion} @@ -409,19 +408,18 @@ class VidUtils { ${failIfExist} ${networkModelName} - ${networkModelVersionId} - ${networkModelInvariantId} + ${networkModelUuid} + ${networkModelInvariantUuid} ${networkModelVersion} - ${networkModelCustomizationId} - ${networkModelType} + ${networkModelCustomizationUuid} ${serviceModelName} - ${serviceModelVersionId} - ${serviceModelInvariantId} + ${serviceModelUuid} + ${serviceModelInvariantUuid} ${serviceModelVersion} - ${serviceModelCustomizationId} - ${serviceModelType} + ${serviceModelCustomizationUuid} + ${sdncVersion} @@ -504,9 +502,9 @@ class VidUtils { def serviceId = requestMap.requestDetails?.requestParameters?.serviceId ?: '' def aicCloudRegion = requestMap.requestDetails?.cloudConfiguration?.lcpCloudRegionId ?: '' def tenantId = requestMap.requestDetails?.cloudConfiguration?.tenantId ?: '' - def personaModelId = requestMap.requestDetails?.modelInfo?.modelInvariantId ?: '' - def personaModelVersion = requestMap.requestDetails?.modelInfo?.modelVersion ?: '' - def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationId ?: '' + def personaModelId = requestMap.requestDetails?.modelInfo?.modelInvariantUuid ?: '' + def personaModelVersion = requestMap.requestDetails?.modelInfo?.modelUuid ?: '' + def modelCustomizationId = requestMap.requestDetails?.modelInfo?.modelCustomizationUuid ?: '' def xmlReq = """ diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1.groovy index 0ec9c93862..93a3d2426c 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/openecomp/mso/bpmn/common/scripts/VnfAdapterRestV1.groovy @@ -269,6 +269,7 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { } catch (Exception e) { String msg = 'Caught exception in ' + method + ": " + e logError(msg) + logDebug(msg) exceptionUtil.buildAndThrowWorkflowException(execution, 2000, msg) } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java index 214ae28b70..49e42acaf6 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/AbstractCallbackService.java @@ -108,7 +108,7 @@ public abstract class AbstractCallbackService { protected boolean correlate(String messageEventName, String correlationVariable, String correlationValue, Map variables, String logMarker) throws Exception { - + try{ LOGGER.debug(logMarker + " Attempting to find process waiting" + " for " + messageEventName + " with " + correlationVariable + " = '" + correlationValue + "'"); @@ -240,6 +240,16 @@ public abstract class AbstractCallbackService { LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, msg, e); } + } catch (Exception e) { + // This must be an exception from the flow itself. Log it, but don't + // report it back to the client. + String msg = "Caught " + e.getClass().getSimpleName() + " after receiving " + messageEventName + + " with " + correlationVariable + " = '" + correlationValue + + "': " + e; + LOGGER.debug(msg); + LOGGER.error(MessageEnum.BPMN_GENERAL_EXCEPTION, "BPMN CORRELATION ERROR -", MsoLogger.getServiceName(), + MsoLogger.ErrorCode.UnknownError, msg, e); + } return true; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java deleted file mode 100644 index f3ad810a3e..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncCommonResource.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - MSO - * ================================================================================ - * 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.openecomp.mso.bpmn.common.workflow.service; - -import org.camunda.bpm.engine.ProcessEngineServices; -import org.camunda.bpm.engine.ProcessEngines; - - -public class WorkflowAsyncCommonResource extends WorkflowAsyncResource { - - protected ProcessEngineServices getProcessEngineServices() { - return pes4junit.orElse(ProcessEngines.getProcessEngine("common")); - } -} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java index 1bd1dfde70..382d2b7feb 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowAsyncResource.java @@ -21,8 +21,6 @@ package org.openecomp.mso.bpmn.common.workflow.service; import java.util.HashMap; import java.util.Map; -import java.util.Objects; -import java.util.Optional; import java.util.UUID; import javax.ws.rs.Consumes; @@ -33,6 +31,7 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import org.camunda.bpm.engine.ProcessEngineServices; +import org.camunda.bpm.engine.ProcessEngines; import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.camunda.bpm.engine.variable.impl.VariableMapImpl; @@ -53,15 +52,15 @@ import org.slf4j.MDC; * For asynchronous process - the activity may send a acknowledgement response and then proceed further on executing the process */ @Path("/async") -public abstract class WorkflowAsyncResource { +public class WorkflowAsyncResource { - private static final WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance(); - protected Optional pes4junit = Optional.empty(); + private WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance(); + protected ProcessEngineServices pes4junit = null; - private final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL); + private MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL); private static final String logMarker = "[WRKFLOW-RESOURCE]"; - private static final long DEFAULT_WAIT_TIME = 30000; //default wait time + private static final int DEFAULT_WAIT_TIME = 30000; //default wait time /** * Asynchronous JAX-RS method that starts a process instance. @@ -76,6 +75,7 @@ public abstract class WorkflowAsyncResource { public void startProcessInstanceByKey(final @Suspend(180000) AsynchronousResponse asyncResponse, @PathParam("processKey") String processKey, VariableMapImpl variableMap) { + WorkflowResponse response = new WorkflowResponse(); long startTime = System.currentTimeMillis(); Map inputVariables = null; WorkflowContext workflowContext = null; @@ -107,7 +107,6 @@ public abstract class WorkflowAsyncResource { } msoLogger.debug(logMarker + "Exception in startProcessInstance by key"); - WorkflowResponse response = new WorkflowResponse(); response.setMessage("Fail" ); response.setResponse("Error occurred while executing the process: " + e); response.setMessageCode(500); @@ -206,28 +205,29 @@ public abstract class WorkflowAsyncResource { return contextHolder.processCallback(processKey, processInstanceId, requestId, callbackResponse); } - private static String getOrCreate(Map inputVariables, String key) { - String value = Objects.toString(inputVariables.get(key), null); - if (value == null) { - value = UUID.randomUUID().toString(); - inputVariables.put(key, value); - } - return value; - } - // Note: the business key is used to identify the process in unit tests - private static String getBusinessKey(Map inputVariables) { - return getOrCreate(inputVariables, "mso-business-key"); + private String getBusinessKey(Map inputVariables) { + Object businessKey = inputVariables.get("mso-business-key"); + if (businessKey == null ) { + businessKey = UUID.randomUUID().toString(); + inputVariables.put("mso-business-key", businessKey); + } + return businessKey.toString(); } - private static String getRequestId(Map inputVariables) { - return getOrCreate(inputVariables, "mso-request-id"); + private String getRequestId(Map inputVariables) { + Object requestId = inputVariables.get("mso-request-id"); + if (requestId == null ) { + requestId = UUID.randomUUID().toString(); + inputVariables.put("mso-request-id", requestId); + } + return requestId.toString(); } private long getWaitTime(Map inputVariables) { - - String timeout = Objects.toString(inputVariables.get("mso-service-request-timeout"), null); + String timeout = inputVariables.get("mso-service-request-timeout") == null + ? null : inputVariables.get("mso-service-request-timeout").toString(); if (timeout != null) { try { @@ -252,7 +252,7 @@ public abstract class WorkflowAsyncResource { } - private static void setLogContext(String processKey, + private void setLogContext(String processKey, Map inputVariables) { MsoLogger.setServiceName("MSO." + processKey); if (inputVariables != null) { @@ -260,24 +260,32 @@ public abstract class WorkflowAsyncResource { } } - private static String getKeyValueFromInputVariables(Map inputVariables, String key) { + private String getKeyValueFromInputVariables(Map inputVariables, String key) { if (inputVariables == null) return ""; - return Objects.toString(inputVariables.get(key), "N/A"); + Object requestId = inputVariables.get(key); + if (requestId != null) return requestId.toString(); + return "N/A"; } private boolean isProcessEnded(String processInstanceId) { ProcessEngineServices pes = getProcessEngineServices(); - return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null; + return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null ? true : false ; } - protected abstract ProcessEngineServices getProcessEngineServices(); + protected ProcessEngineServices getProcessEngineServices() { + if (pes4junit == null) { + return ProcessEngines.getDefaultProcessEngine(); + } else { + return pes4junit; + } + } public void setProcessEngineServices4junit(ProcessEngineServices pes) { - pes4junit = Optional.ofNullable(pes); + pes4junit = pes; } - private static Map getInputVariables(VariableMapImpl variableMap) { + private Map getInputVariables(VariableMapImpl variableMap) { Map inputVariables = new HashMap(); @SuppressWarnings("unchecked") Map vMap = (Map) variableMap.get("variables"); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContext.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContext.java index 93aa15c59a..3d7e333fdf 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContext.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowContext.java @@ -72,7 +72,7 @@ public class WorkflowContext implements Delayed { @Override public long getDelay(TimeUnit unit) { // 0 or negative means this object is considered to be expired - return unit.convert(startTime + timeout - System.currentTimeMillis(), TimeUnit.MILLISECONDS); + return unit.convert(startTime + timeout - System.currentTimeMillis(), unit); } /** diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java index a9a9f4b12d..8d049634c7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResource.java @@ -255,7 +255,11 @@ public class WorkflowResource { */ private boolean isProcessEnded(String processInstanceId) { ProcessEngineServices pes = getProcessEngineServices(); - return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null ? true : false ; + try { + return pes.getRuntimeService().createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult() == null ? true : false ; + } catch (Exception e) { + return true; + } } private void processResponseMap(WorkflowResponse workflowResponse, Map responseMap) { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java index d6c9b51cd6..89f9f28901 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/bpmn/common/workflow/service/WorkflowResourceApplication.java @@ -41,7 +41,7 @@ public class WorkflowResourceApplication extends Application { public WorkflowResourceApplication() { singletons.add(new WorkflowResource()); - singletons.add(new WorkflowAsyncCommonResource()); + singletons.add(new WorkflowAsyncResource()); singletons.add(new WorkflowMessageResource()); } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIClientResponseExceptionMapper.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIClientResponseExceptionMapper.java new file mode 100644 index 0000000000..3189d4467d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIClientResponseExceptionMapper.java @@ -0,0 +1,71 @@ +package org.openecomp.mso.client.aai; + +import java.io.IOException; + +import javax.annotation.Priority; +import javax.ws.rs.BadRequestException; +import javax.ws.rs.ForbiddenException; +import javax.ws.rs.InternalServerErrorException; +import javax.ws.rs.NotAcceptableException; +import javax.ws.rs.NotAllowedException; +import javax.ws.rs.NotAuthorizedException; +import javax.ws.rs.NotFoundException; +import javax.ws.rs.NotSupportedException; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientResponseContext; +import javax.ws.rs.client.ClientResponseFilter; +import javax.ws.rs.core.Response; +import javax.ws.rs.ext.Provider; + +import org.openecomp.mso.client.aai.entities.AAIError; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@Provider +@Priority(value = 1) +public class AAIClientResponseExceptionMapper implements ClientResponseFilter { + + @Override + public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { + if (responseContext.getStatus() != Response.Status.OK.getStatusCode() && responseContext.hasEntity()) { + AAIError error = new ObjectMapper().readValue(responseContext.getEntityStream(), AAIError.class); + String message = error.getRequestError().getServiceException().getText(); + + Response.Status status = Response.Status.fromStatusCode(responseContext.getStatus()); + WebApplicationException webAppException; + switch (status) { + case BAD_REQUEST: + webAppException = new BadRequestException(message); + break; + case UNAUTHORIZED: + webAppException = new NotAuthorizedException(message); + break; + case FORBIDDEN: + webAppException = new ForbiddenException(message); + break; + case NOT_FOUND: + webAppException = new NotFoundException(message); + break; + case METHOD_NOT_ALLOWED: + webAppException = new NotAllowedException(message); + break; + case NOT_ACCEPTABLE: + webAppException = new NotAcceptableException(message); + break; + case UNSUPPORTED_MEDIA_TYPE: + webAppException = new NotSupportedException(message); + break; + case INTERNAL_SERVER_ERROR: + webAppException = new InternalServerErrorException(message); + break; + case SERVICE_UNAVAILABLE: + webAppException = new WebApplicationException(message); + break; + default: + webAppException = new WebApplicationException(message); + } + throw webAppException; + } + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAICommonObjectMapperProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAICommonObjectMapperProvider.java new file mode 100644 index 0000000000..83435a8c69 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAICommonObjectMapperProvider.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.client.aai; + +import javax.ws.rs.ext.ContextResolver; +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +@Provider +public class AAICommonObjectMapperProvider implements ContextResolver { + + final ObjectMapper mapper; + + public AAICommonObjectMapperProvider() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + mapper.enable(MapperFeature.USE_ANNOTATIONS); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); + mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIQueryObjectMapperProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIQueryObjectMapperProvider.java new file mode 100644 index 0000000000..a6d693b02a --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIQueryObjectMapperProvider.java @@ -0,0 +1,47 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.client.aai; + +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.databind.AnnotationIntrospector; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; +import com.fasterxml.jackson.databind.type.TypeFactory; +import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector; + +@Provider +public class AAIQueryObjectMapperProvider extends AAICommonObjectMapperProvider { + + public AAIQueryObjectMapperProvider() { + super(); + AnnotationIntrospector aiJaxb = new JaxbAnnotationIntrospector(TypeFactory.defaultInstance()); + AnnotationIntrospector aiJackson = new JacksonAnnotationIntrospector(); + // first Jaxb, second Jackson annotations + mapper.setAnnotationIntrospector(AnnotationIntrospector.pair(aiJaxb, aiJackson)); + + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIResourcesObjectMapperProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIResourcesObjectMapperProvider.java new file mode 100644 index 0000000000..339fea5067 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIResourcesObjectMapperProvider.java @@ -0,0 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.client.aai; + +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.databind.ObjectMapper; + +@Provider +public class AAIResourcesObjectMapperProvider extends AAICommonObjectMapperProvider { + + public AAIResourcesObjectMapperProvider() { + super(); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java new file mode 100644 index 0000000000..8d96437e68 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClient.java @@ -0,0 +1,24 @@ +package org.openecomp.mso.client.aai; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.List; + +import org.openecomp.aai.domain.yang.GenericVnf; +import org.openecomp.aai.domain.yang.Pserver; +import org.openecomp.aai.domain.yang.Pservers; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; + +public interface AAIRestClient { + + Pservers getPhysicalServers(String hostName, String uuid); + + List getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid) throws UnsupportedEncodingException, JsonParseException, JsonMappingException, IOException; + + void updateMaintenceFlag(String vnfId,boolean inMaint, String transactionLoggingUuid) throws Exception; + + void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) throws Exception; + + GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws Exception; +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java new file mode 100644 index 0000000000..99024490a3 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIRestClientImpl.java @@ -0,0 +1,167 @@ +package org.openecomp.mso.client.aai; + +import java.io.File; +import java.io.IOException; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import javax.net.ssl.SSLContext; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; + +import org.openecomp.aai.domain.yang.GenericVnf; +import org.openecomp.aai.domain.yang.GenericVnfs; +import org.openecomp.aai.domain.yang.Pserver; +import org.openecomp.aai.domain.yang.Pservers; +import org.openecomp.mso.bpmn.core.PropertyConfiguration; +import org.openecomp.mso.client.aai.entities.CustomQuery; +import org.openecomp.mso.client.aai.entities.Results; +import org.openecomp.mso.logger.MsoLogger; +import org.openecomp.mso.properties.MsoPropertiesFactory; +import org.springframework.stereotype.Service; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +@Service +public class AAIRestClientImpl implements AAIRestClient { + + private final WebTarget webTarget; + + private static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory(); + + private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); + + private static final String ENDPOINT_VERSION = "v10"; + private static final String ENDPOINT_GET_ALL = ENDPOINT_VERSION + "/cloud-infrastructure/pservers"; + private static final String ENDPOINT_GET_ALL_VNFS = ENDPOINT_VERSION + "/network/generic-vnfs"; + private static final String ENDPOINT_CUSTOM_QUERY = ENDPOINT_VERSION + "/query"; + private static final String PSERVER_BY_VNF_QUERY = "g.V().has('aai-node-type', 'generic-vnf').has('vnf-name','USAUTOUFTIL2001UJDM02').out('runsOnPserver').has('aai-node-type', 'pserver')"; + private static final String PSERVER_VNF_QUERY = "pservers-fromVnf"; + private static final String GENERIC_VNF_PATH = ENDPOINT_VERSION + "/network/generic-vnfs/generic-vnf"; + private static final String SERVICE_TOPOLOGY_BY_SERVICE_INSTANCE_ID = "store(‘x’).union(__.in(‘subscribesTo’).has(‘aai-node-type’,’customer’).store(‘x’),__.out(‘uses’).has(‘aai-node-type’,’allotted-resource’).store(‘x’),__.in(‘hasInstance’).has(‘aai-node-type’,’generic-vnf’).store(‘x’).union(" + + ".out(‘has’).has(‘aai-node-type’,’vf-module’).store(‘x’),out(‘uses’).has(‘aai-node-type’,’volume-group’).store(‘x’)," + + ".out(‘hasLInterface’).has(‘aai-node-type’,’l-interface’).union(" + + ".out(‘hasIpAddress’).has(‘aai-node-type’,’l3-interface-ipv4-address’).store(‘x’).out(‘isMemberOf’).has(‘aai-node-type’,’l3-network’).store(‘x’)," + + ".out(‘hasIpAddress’).has(‘aai-node-type’,’l3-interface-ipv6-address’).store(‘x’).out(‘isMemberOf’).has(‘aai-node-type’,’l3-network’).store(‘x’)" + + ")," + ".out(‘runsOnVserver’).has(‘aai-node-type’,’vserver’).store(‘x’).union(" + + ".in(‘owns’).has(‘aai-node-type’,’tenant’).store(‘x’).in(‘has’).has(‘aai-node-type’,’cloud-region’).store(‘x’)," + + ".out(‘runsOnPserver’).has(‘aai-node-type’,’pserver’).store(‘x’)," + + ".out(‘hasLInterface’).has(‘aai-node-type’,’l-interface’).union(" + + ".out(‘hasIpAddress’).has(‘aai-node-type’,’l3-interface-ipv4-address’).store(‘x’).out(‘isMemberOf’).has(‘aai-node-type’,’l3-network’).store(‘x’)," + + ".out(‘hasIpAddress’).has(‘aai-node-type’,’l3-interface-ipv6-address’).store(‘x’).out(‘isMemberOf’).has(‘aai-node-type’,’l3-network’).store(‘x’)" + + ")" + ")" + ")" + ").cap(‘x’).unfold().dedup()"; + + public AAIRestClientImpl() throws NoSuchAlgorithmException { + + Logger logger = Logger.getLogger(getClass().getName()); + Map properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); + Client client = this.getSSLClient(); + webTarget = client.register(logger).register(new AAIClientResponseExceptionMapper()) + .target(properties.get("aai.endpoint") + "/aai"); + } + + public AAIRestClientImpl(final String host) throws NoSuchAlgorithmException { + Logger logger = Logger.getLogger(getClass().getName()); + Client client = this.getSSLClient(); + Map properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); + webTarget = client.register(logger).register(new AAIClientResponseExceptionMapper()).target(host + "/aai"); + } + + @Override + public Pservers getPhysicalServers(String hostName, String uuid) { + return webTarget.register(AAIResourcesObjectMapperProvider.class).path(ENDPOINT_GET_ALL).request() + .header("X-FromAppId", "MSO").header("X-TransactionId", uuid) + .header("Content-Type", MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).get() + .readEntity(Pservers.class); + } + + @Override + public List getPhysicalServerByVnfId(String vnfId, String transactionLoggingUuid) + throws JsonParseException, JsonMappingException, IOException { + List startNodes = new ArrayList(); + startNodes.add("network/generic-vnfs/generic-vnf/" + vnfId); + String jsonInput = webTarget.register(AAIQueryObjectMapperProvider.class).path(ENDPOINT_CUSTOM_QUERY) + .queryParam("format", "resource").request().header("X-FromAppId", "MSO") + .header("X-TransactionId", transactionLoggingUuid) + .header("Content-Type", MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE) + .put(Entity.entity(new CustomQuery(startNodes, PSERVER_VNF_QUERY), MediaType.APPLICATION_JSON)) + .readEntity(String.class); + + + return this.getListOfPservers(jsonInput); + } + + protected List getListOfPservers(String jsonInput) throws JsonParseException, JsonMappingException, IOException + { + ObjectMapper mapper = new AAIQueryObjectMapperProvider().getContext(Object.class); + Results> resultsFromJson = mapper.readValue(jsonInput, + new TypeReference>>() { + }); + List results = new ArrayList<>(); + for (Map m : resultsFromJson.getResult()) { + results.add(m.get("pserver")); + } + return results; + } + + protected List getListOfPservers(File jsonInput) throws JsonParseException, JsonMappingException, IOException + { + ObjectMapper mapper = new AAIQueryObjectMapperProvider().getContext(Object.class); + Results> resultsFromJson = mapper.readValue(jsonInput, + new TypeReference>>() { + }); + List results = new ArrayList<>(); + for (Map m : resultsFromJson.getResult()) { + results.add(m.get("pserver")); + } + return results; + } + + @Override + public void updateMaintenceFlag(String vnfName, boolean inMaint, String transactionLoggingUuid) throws Exception { + GenericVnfs genericVnfs = webTarget.register(AAIResourcesObjectMapperProvider.class).path(ENDPOINT_GET_ALL_VNFS) + .queryParam("vnf-name", vnfName).request().header("X-FromAppId", "MSO") + .header("X-TransactionId", transactionLoggingUuid).header("Content-Type", "application/json") + .accept(MediaType.APPLICATION_JSON_TYPE).get().readEntity(GenericVnfs.class); + + if (genericVnfs.getGenericVnf().size() > 1) + throw new Exception("Multiple Generic Vnfs Returned"); + + GenericVnf genericVnf = genericVnfs.getGenericVnf().get(0); + updateMaintenceFlagVnfId(genericVnf.getVnfId(), inMaint, transactionLoggingUuid); + } + + @Override + public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) + throws Exception { + GenericVnf genericVnf = new GenericVnf(); + genericVnf.setInMaint(inMaint); + webTarget.register(AAIResourcesObjectMapperProvider.class).path(GENERIC_VNF_PATH + "/" + vnfId).request() + .header("X-FromAppId", "MSO").header("X-TransactionId", transactionLoggingUuid) + .header("Content-Type", "application/merge-patch+json") + .header("Accept", MediaType.APPLICATION_JSON_TYPE).header("X-HTTP-Method-Override", "PATCH") + .put(Entity.entity(genericVnf, MediaType.valueOf("application/merge-patch+json"))); + } + + @Override + public GenericVnf getVnfByName(String vnfId, String transactionLoggingUuid) throws Exception { + return webTarget.register(AAIResourcesObjectMapperProvider.class).path(GENERIC_VNF_PATH + "/" + vnfId).request() + .header("X-FromAppId", "MSO").header("X-TransactionId", transactionLoggingUuid) + .header("Content-Type", "application/json").accept(MediaType.APPLICATION_JSON_TYPE).get() + .readEntity(GenericVnf.class); + } + + protected Client getSSLClient() throws NoSuchAlgorithmException { + return ClientBuilder.newBuilder().sslContext(SSLContext.getDefault()).build(); + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdator.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdator.java new file mode 100644 index 0000000000..787158f8c6 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdator.java @@ -0,0 +1,11 @@ +package org.openecomp.mso.client.aai; + +import java.io.IOException; + +public interface AAIUpdator { + + void updateVnfToLocked(String vnfName, String uuid) throws IOException, Exception; + + void updateVnfToUnLocked(String vnfName, String uuid) throws IOException, Exception; + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdatorImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdatorImpl.java new file mode 100644 index 0000000000..50b3e61d96 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIUpdatorImpl.java @@ -0,0 +1,29 @@ +package org.openecomp.mso.client.aai; + +import org.springframework.beans.factory.annotation.Autowired; + +public class AAIUpdatorImpl implements AAIUpdator { + + @Autowired + protected AAIRestClient client; + + public AAIRestClient getClient() { + return client; + } + + + public void setClient(AAIRestClient client) { + this.client = client; + } + + @Override + public void updateVnfToLocked(String vnfId, String uuid) throws Exception { + client.updateMaintenceFlagVnfId(vnfId, true, uuid); + } + + @Override + public void updateVnfToUnLocked(String vnfId, String uuid) throws Exception { + client.updateMaintenceFlagVnfId(vnfId, false, uuid); + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidator.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidator.java new file mode 100644 index 0000000000..5ec2dd679d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidator.java @@ -0,0 +1,12 @@ +package org.openecomp.mso.client.aai; + +import java.io.IOException; + +public interface AAIValidator { + + boolean isPhysicalServerLocked(String hostName, String transactionLoggingUuid) throws IOException; + + boolean isVNFLocked(String vnfId, String transactionLoggingUuid) throws IOException, Exception; + + +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidatorImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidatorImpl.java new file mode 100644 index 0000000000..be39c5fb8b --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/AAIValidatorImpl.java @@ -0,0 +1,51 @@ +package org.openecomp.mso.client.aai; + +import java.io.IOException; +import java.util.List; + +import org.openecomp.aai.domain.yang.GenericVnf; +import org.openecomp.aai.domain.yang.Pserver; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + + +@Service +public class AAIValidatorImpl implements AAIValidator { + + + @Autowired + protected AAIRestClient client; + + public AAIRestClient getClient() { + return client; + } + + + public void setClient(AAIRestClient client) { + this.client = client; + } + + @Override + public boolean isPhysicalServerLocked(String vnfId, String transactionLoggingUuid) throws IOException { + List pservers; + boolean isLocked = false; + pservers = client.getPhysicalServerByVnfId(vnfId, transactionLoggingUuid); + for (Pserver pserver : pservers) + if (pserver.isInMaint()) + isLocked = true; + + return isLocked; + } + + @Override + public boolean isVNFLocked(String vnfId, String transactionLoggingUuid) throws Exception { + boolean isLocked = false; + GenericVnf genericVnf = client.getVnfByName(vnfId, transactionLoggingUuid); + if (genericVnf.isInMaint()) + isLocked = true; + + return isLocked; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIEntity.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIEntity.java new file mode 100644 index 0000000000..a34b96efce --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIEntity.java @@ -0,0 +1,5 @@ +package org.openecomp.mso.client.aai.entities; + +public class AAIEntity { + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIError.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIError.java new file mode 100644 index 0000000000..900587224f --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/AAIError.java @@ -0,0 +1,27 @@ + +package org.openecomp.mso.client.aai.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "requestError" +}) +public class AAIError { + + @JsonProperty("requestError") + private RequestError requestError; + + @JsonProperty("requestError") + public RequestError getRequestError() { + return requestError; + } + + @JsonProperty("requestError") + public void setRequestError(RequestError requestError) { + this.requestError = requestError; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/CustomQuery.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/CustomQuery.java new file mode 100644 index 0000000000..fb37899e0d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/CustomQuery.java @@ -0,0 +1,48 @@ +package org.openecomp.mso.client.aai.entities; + +import java.io.UnsupportedEncodingException; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CustomQuery { + + List start; + + public String getGremlin() { + return gremlin; + } + + public void setGremlin(String gremlin) { + this.gremlin = gremlin; + } + String query; + String gremlin; + + public CustomQuery(Liststart, String query){ + this.start=start; + this.query= "query/" + query; + } + + public CustomQuery(String gremlin) throws UnsupportedEncodingException{ + this.gremlin=gremlin; + } + + public List getStart() { + return start; + } + + public void setStart(List start) { + this.start = start; + } + + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/RequestError.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/RequestError.java new file mode 100644 index 0000000000..525d983940 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/RequestError.java @@ -0,0 +1,27 @@ + +package org.openecomp.mso.client.aai.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "serviceException" +}) +public class RequestError { + + @JsonProperty("serviceException") + private ServiceException serviceException; + + @JsonProperty("serviceException") + public ServiceException getServiceException() { + return serviceException; + } + + @JsonProperty("serviceException") + public void setServiceException(ServiceException serviceException) { + this.serviceException = serviceException; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java new file mode 100644 index 0000000000..384ac25246 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/Results.java @@ -0,0 +1,33 @@ +package org.openecomp.mso.client.aai.entities; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlType; + + +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "", propOrder = { + "results" +}) +@XmlRootElement(name = "results") +public class Results { + + @XmlElement(name="results") + protected List result; + + public List getResult() { + if (result == null) { + result = new ArrayList(); + } + return this.result; + } + + public void setResult(List result) { + this.result=result; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/ServiceException.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/ServiceException.java new file mode 100644 index 0000000000..0ea3ebb061 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/aai/entities/ServiceException.java @@ -0,0 +1,54 @@ + +package org.openecomp.mso.client.aai.entities; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "messageId", + "text", + "variables" +}) +public class ServiceException { + + @JsonProperty("messageId") + private String messageId; + @JsonProperty("text") + private String text; + @JsonProperty("variables") + private List variables = null; + + @JsonProperty("messageId") + public String getMessageId() { + return messageId; + } + + @JsonProperty("messageId") + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @JsonProperty("text") + public void setText(String text) { + this.text = text; + } + + @JsonProperty("variables") + public List getVariables() { + return variables; + } + + @JsonProperty("variables") + public void setVariables(List variables) { + this.variables = variables; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerCallback.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerCallback.java new file mode 100644 index 0000000000..794f112fa9 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerCallback.java @@ -0,0 +1,19 @@ +package org.openecomp.mso.client.appc; +import org.openecomp.appc.client.lcm.api.ResponseHandler; +import org.openecomp.appc.client.lcm.exceptions.AppcClientException; + +public class ApplicationControllerCallback implements ResponseHandler { + + @Override + public void onResponse(T response) { + System.out.println("ON RESPONSE"); + + } + + @Override + public void onException(AppcClientException exception) { + System.out.println("ON EXCEPTION"); + + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java new file mode 100644 index 0000000000..e8dc5af90c --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java @@ -0,0 +1,147 @@ +package org.openecomp.mso.client.appc; + +import java.beans.BeanInfo; + +import java.util.Map; + +import org.openecomp.mso.bpmn.core.PropertyConfiguration; + +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.time.Instant; +import java.util.Properties; +import java.util.UUID; + +import org.springframework.beans.factory.annotation.Autowired; + +import org.openecomp.appc.client.lcm.api.AppcClientServiceFactoryProvider; +import org.openecomp.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; +import org.openecomp.appc.client.lcm.api.ApplicationContext; +import org.openecomp.appc.client.lcm.api.LifeCycleManagerStateful; +import org.openecomp.appc.client.lcm.api.ResponseHandler; +import org.openecomp.appc.client.lcm.exceptions.AppcClientException; +import org.openecomp.appc.client.lcm.model.Action; +import org.openecomp.appc.client.lcm.model.ActionIdentifiers; +import org.openecomp.appc.client.lcm.model.AuditOutput; +import org.openecomp.appc.client.lcm.model.CommonHeader; +import org.openecomp.appc.client.lcm.model.Flags; +import org.openecomp.appc.client.lcm.model.Flags.Force; +import org.openecomp.appc.client.lcm.model.Flags.Mode; +import org.openecomp.appc.client.lcm.model.Payload; +import org.openecomp.appc.client.lcm.model.Status; +import org.openecomp.appc.client.lcm.model.ZULU; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; + +public class ApplicationControllerClient { + + private static final int ACCEPT_SERIES = 100; + private static final int ERROR_SERIES = 200; + private static final int REJECT_SERIES = 300; + private static final int SUCCESS_SERIES = 400; + private static final int SUCCESS_STATUS = SUCCESS_SERIES + 0; + private static final int PARTIAL_SERIES = 500; + private static final int PARTIAL_SUCCESS_STATUS = PARTIAL_SERIES + 0; + + private final boolean useLCMBypass = false; + + private final String apiVer = "2.00"; + private final String originatorId = "MSO"; + private final int flagsTTL = 65000; + private final static String clientName = "MSO"; + + @Autowired + public ApplicationControllerSupport appCSupport; + + private LifeCycleManagerStateful client; + + public Status runCommand(Action action, ActionIdentifiers identifier, Flags flags, Payload payload, + String requestID) throws Exception { + Object requestObject = createRequest(action, identifier, flags, payload, requestID); + client = getAppCClient(); + Method lcmMethod = appCSupport.getAPIMethod(action.name(), client, false); + appCSupport.logLCMMessage(requestObject); + Object response = lcmMethod.invoke(client, requestObject); + return appCSupport.getStatusFromGenericResponse(response); + } + + public void shutdownclient() { + AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class) + .shutdownLifeCycleManager(false); + } + + public LifeCycleManagerStateful getAppCClient() throws AppcClientException { + if (client == null) + client = AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class) + .createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties()); + return client; + } + + private Properties getLCMProperties() { + return getLCMPropertiesHelper(); + } + + protected Properties getLCMPropertiesHelper() { + Properties properties = new Properties(); + Map globalProperties = PropertyConfiguration.getInstance() + .getProperties("mso.bpmn.urn.properties"); + + properties.put("topic.read", globalProperties.get("appc.topic.read")); + properties.put("topic.read.timeout", globalProperties.get("appc.topic.read.timeout")); + properties.put("client.response.timeout", globalProperties.get("appc.client.response.timeout")); + properties.put("topic.write", globalProperties.get("appc.topic.write")); + properties.put("poolMembers", globalProperties.get("appc.pool.members")); + properties.put("client.key", globalProperties.get("appc.client.key")); + properties.put("client.secret", globalProperties.get("appc.client.secret")); + properties.put("client.name", clientName); + return properties; + } + + public Object createRequest(Action action, ActionIdentifiers identifier, Flags flags, Payload payload, + String requestId) throws Exception { + Object requestObject = appCSupport.getInput(action.name()); + try { + org.openecomp.appc.client.lcm.model.CommonHeader commonHeader = buildCommonHeader(requestId); + requestObject.getClass().getDeclaredMethod("setCommonHeader", CommonHeader.class).invoke(requestObject, + commonHeader); + requestObject.getClass().getDeclaredMethod("setAction", Action.class).invoke(requestObject, action); + requestObject.getClass().getDeclaredMethod("setActionIdentifiers", ActionIdentifiers.class) + .invoke(requestObject, identifier); + } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + throw new Exception("Error Building AppC Request: " + e.getMessage()); + } + return requestObject; + } + + private org.openecomp.appc.client.lcm.model.CommonHeader buildCommonHeader(String requestId) { + org.openecomp.appc.client.lcm.model.CommonHeader commonHeader = new org.openecomp.appc.client.lcm.model.CommonHeader(); + commonHeader.setApiVer(apiVer); + commonHeader.setOriginatorId(originatorId); + commonHeader.setRequestId(requestId == null ? UUID.randomUUID().toString() : requestId); + commonHeader.setSubRequestId(requestId); + org.openecomp.appc.client.lcm.model.Flags flags = new org.openecomp.appc.client.lcm.model.Flags(); + String flagsMode = "NORMAL"; + Mode mode = Mode.valueOf(flagsMode); + flags.setMode(mode); + String flagsForce = "FALSE"; + Force force = Force.valueOf(flagsForce); + flags.setForce(force); + flags.setTtl(flagsTTL); + commonHeader.setFlags(flags); + Instant timestamp = Instant.now(); + ZULU zulu = new ZULU(timestamp.toString()); + commonHeader.setTimestamp(zulu); + return commonHeader; + } + + public Flags createRequestFlags() { + Flags flags = new Flags(); + flags.setTtl(6000); + return flags; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerSupport.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerSupport.java new file mode 100644 index 0000000000..c0f1a2067e --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerSupport.java @@ -0,0 +1,226 @@ +package org.openecomp.mso.client.appc; + + +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Properties; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.ClassPathResource; +import org.springframework.core.io.Resource; +import org.springframework.core.io.support.PropertiesLoaderUtils; +import org.springframework.stereotype.Component; + +import org.openecomp.appc.client.lcm.api.AppcClientServiceFactoryProvider; +import org.openecomp.appc.client.lcm.api.AppcLifeCycleManagerServiceFactory; +import org.openecomp.appc.client.lcm.api.ApplicationContext; +import org.openecomp.appc.client.lcm.api.LifeCycleManagerStateful; +import org.openecomp.appc.client.lcm.api.ResponseHandler; +import org.openecomp.appc.client.lcm.exceptions.AppcClientException; +import org.openecomp.appc.client.lcm.model.Status; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; + + +@Component +public class ApplicationControllerSupport { + + private static final int ACCEPT_SERIES = 100; + private static final int ERROR_SERIES = 200; + private static final int REJECT_SERIES = 300; + private static final int SUCCESS_SERIES = 400; + private static final int SUCCESS_STATUS = SUCCESS_SERIES + 0; + private static final int PARTIAL_SERIES = 500; + private static final int PARTIAL_SUCCESS_STATUS = PARTIAL_SERIES + 0; + private static final int PARTIAL_FAILURE_STATUS = PARTIAL_SERIES + 1; + + @Value("${lcm.model.package:org.openecomp.appc.client.lcm.model}") + private String lcmModelPackage; + + public LifeCycleManagerStateful createService() throws AppcClientException, IOException { + AppcLifeCycleManagerServiceFactory factory = AppcClientServiceFactoryProvider + .getFactory(AppcLifeCycleManagerServiceFactory.class); + return factory.createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties()); + } + + /** + * @param inputClass + * @return + * @throws ClassNotFoundException + * @throws InstantiationException + * @throws IllegalAccessException + */ + public Object getInput(String action) { + try { + return getInputClass(action).newInstance(); + } catch (IllegalAccessException | InstantiationException e) { + throw new RuntimeException( + String.format("%s : %s", "Unable to instantiate viable LCM Kit input class for action", action), e); + } + } + + /** + * @param action + * @return + * @throws ClassNotFoundException + */ + public Method getAPIMethod(String action, LifeCycleManagerStateful lcmStateful, boolean async) { + Method[] methods = lcmStateful.getClass().getMethods(); + for (Method method : methods) { + if (method.getName().equalsIgnoreCase(action)) { + Class[] methodParameterTypes = method.getParameterTypes(); + if (methodParameterTypes.length > 0) { + if (getInputClass(action).equals(methodParameterTypes[0])) { + if (async) { + if (methodParameterTypes.length == 2 + && ResponseHandler.class.isAssignableFrom(methodParameterTypes[1])) { + return method; + } + } else if (methodParameterTypes.length == 1) { + return method; + } + } + } + } + } + throw new RuntimeException(String.format("%s : %s, async=%b", + "Unable to derive viable LCM Kit API method for action", action, async)); + } + + public Method getCommonHeaderSetterMethod(String action) { + return getBeanPropertyMethodFor(getInputClass(action), "commonHeader", true); + } + + public Method getPayloadSetterMethod(String action) { + return getBeanPropertyMethodFor(getInputClass(action), "payload", true); + } + + public Status getStatusFromGenericResponse(Object response) { + Method statusReader = getBeanPropertyMethodFor(response.getClass(), "status", false); + if (statusReader != null) { + try { + return (Status) statusReader.invoke(response); + } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { + throw new RuntimeException(String.format("Unable to obtain status from LCM Kit response", e)); + } + } + return new Status(); + } + + public static StatusCategory getCategoryOf(Status status) { + int codeSeries = status.getCode() - (status.getCode() % 100); + switch (codeSeries) { + case ACCEPT_SERIES: + return StatusCategory.NORMAL; + case ERROR_SERIES: + case REJECT_SERIES: + return StatusCategory.ERROR; + case SUCCESS_SERIES: + return status.getCode() == SUCCESS_STATUS ? StatusCategory.NORMAL : StatusCategory.ERROR; + case PARTIAL_SERIES: + switch (status.getCode()) { + case PARTIAL_SUCCESS_STATUS: + return StatusCategory.NORMAL; + case PARTIAL_FAILURE_STATUS: + return StatusCategory.ERROR; + default: + return StatusCategory.WARNING; + } + default: + return StatusCategory.WARNING; + } + } + + public static boolean getFinalityOf(Status status) { + int codeSeries = status.getCode() - (status.getCode() % 100); + switch (codeSeries) { + case ACCEPT_SERIES: + case PARTIAL_SERIES: + return false; + case ERROR_SERIES: + case REJECT_SERIES: + case SUCCESS_SERIES: + return true; + default: + return true; + } + } + + /** + * @return + * @throws IOException + */ + private Properties getLCMProperties() throws IOException { + Resource resource = new ClassPathResource("/lcm.properties"); + Properties properties = PropertiesLoaderUtils.loadProperties(resource); + return properties; + } + + private Method getBeanPropertyMethodFor(Class clazz, String propertyName, boolean isWriter) { + BeanInfo beanInfo; + try { + beanInfo = Introspector.getBeanInfo(clazz, Object.class); + } catch (IntrospectionException e) { + throw new RuntimeException( + String.format("Unable to produce bean property method for class : %s, property : %s, writer=%b", + clazz.getName(), propertyName, isWriter), + e); + } + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); + for (PropertyDescriptor propertyDescriptor : propertyDescriptors) { + if (propertyDescriptor.getName().equals(propertyName)) { + return isWriter ? propertyDescriptor.getWriteMethod() : propertyDescriptor.getReadMethod(); + } + } + throw new RuntimeException( + String.format("Unable to produce bean property method for class : %s, property : %s, writer=%b", + clazz.getName(), propertyName, isWriter)); + } + + /** + * @param action + * @return + * @throws ClassNotFoundException + */ + private Class getInputClass(String action) { + try { + return Class.forName(lcmModelPackage + '.' + action + "Input"); + } catch (ClassNotFoundException e) { + throw new RuntimeException(String.format("%s : %s using package : ", + "Unable to identify viable LCM Kit input class for action", action, lcmModelPackage), e); + } + } + + public static enum StatusCategory { + NORMAL("normal"), + WARNING("warning"), + ERROR("error"); + + private final String category; + + private StatusCategory(final String category) { + this.category = category; + } + + @Override + public String toString() { + return category; + } + } + + public void logLCMMessage(Object message) throws JsonProcessingException { + ObjectMapper objectMapper = new ObjectMapper(); + objectMapper.setSerializationInclusion(Include.NON_NULL); + ObjectWriter writer = objectMapper.writerWithDefaultPrettyPrinter(); + String inputAsJSON = writer.writeValueAsString(message); + System.out.println("LCM Kit input message follows."); + System.out.println(inputAsJSON); + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java new file mode 100644 index 0000000000..6c0b3ac633 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/Consumer.java @@ -0,0 +1,34 @@ +package org.openecomp.mso.client.dmaap; + +public interface Consumer { + + /** + * Should this consumer continue to consume messages from the topic? + * @return + */ + public boolean continuePolling(); + /** + * Process a message from a DMaaP topic + * + * @param message + * @throws Exception + */ + public void processMessage(String message) throws Exception; + /** + * Has the request been accepted by the receiving system? + * Should the consumer move to processing messages? + * + * @param message + * @return + */ + public boolean isAccepted(String message); + /** + * The request id to filter messages on + * @return + */ + public String getRequestId(); + /** + * Logic that defines when the consumer should stop processing messages + */ + public void stopProcessingMessages(); +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java new file mode 100644 index 0000000000..07ed8719b7 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapConsumer.java @@ -0,0 +1,40 @@ +package org.openecomp.mso.client.dmaap; + +import java.io.FileNotFoundException; +import java.io.IOException; + +import com.att.nsa.mr.client.MRClientFactory; +import com.att.nsa.mr.client.MRConsumer; + +public class DmaapConsumer { + + private final MRConsumer mrConsumer; + public DmaapConsumer() { + mrConsumer = null; + } + public DmaapConsumer (String filepath) throws FileNotFoundException, IOException { + + mrConsumer = MRClientFactory.createConsumer(filepath); + } + + + public MRConsumer getMRConsumer() { + return mrConsumer; + } + public boolean consume(Consumer consumer) throws Exception { + boolean accepted = false; + while (consumer.continuePolling()) { + for (String message : this.getMRConsumer().fetch()) { + if (!accepted && consumer.isAccepted(message)) { + accepted = true; + } + if (accepted) { + consumer.processMessage(message); + } + } + } + + return true; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java new file mode 100644 index 0000000000..bce3e6c3d7 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/dmaap/DmaapPublisher.java @@ -0,0 +1,30 @@ +package org.openecomp.mso.client.dmaap; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + +import com.att.nsa.mr.client.MRBatchingPublisher; +import com.att.nsa.mr.client.MRClientFactory; + +public class DmaapPublisher { + + private final long seconds; + private final MRBatchingPublisher publisher; + + public DmaapPublisher(String filepath) throws FileNotFoundException, IOException { + this.seconds = 20; + this.publisher = MRClientFactory.createBatchingPublisher(filepath); + } + + public DmaapPublisher(String filepath, long seconds) throws FileNotFoundException, IOException { + this.seconds = seconds; + this.publisher = MRClientFactory.createBatchingPublisher(filepath); + } + + public void send(String json) throws IOException, InterruptedException { + publisher.send(json); + publisher.close(seconds, TimeUnit.SECONDS); + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/exceptions/SDNOException.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/exceptions/SDNOException.java new file mode 100644 index 0000000000..b9e3c5d9ad --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/exceptions/SDNOException.java @@ -0,0 +1,19 @@ +package org.openecomp.mso.client.exceptions; + + +public class SDNOException extends Exception { + + private static final long serialVersionUID = 6189163383568887383L; + + public SDNOException() { + super(); + } + + public SDNOException(String string) { + super(string); + } + + public SDNOException(Exception e) { + super(e); + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/CommonObjectMapperProvider.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/CommonObjectMapperProvider.java new file mode 100644 index 0000000000..8e709f21b5 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/CommonObjectMapperProvider.java @@ -0,0 +1,31 @@ +package org.openecomp.mso.client.policy; + +import javax.ws.rs.ext.ContextResolver; + +import javax.ws.rs.ext.Provider; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +@Provider +public class CommonObjectMapperProvider implements ContextResolver { + + final ObjectMapper mapper; + + public CommonObjectMapperProvider() { + + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + mapper.enable(MapperFeature.USE_ANNOTATIONS); + mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); + mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/DecisionAttributes.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/DecisionAttributes.java new file mode 100644 index 0000000000..2325955950 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/DecisionAttributes.java @@ -0,0 +1,74 @@ + +package org.openecomp.mso.client.policy; + + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "ServiceType", "VNFType", "BB_ID", "WorkStep", "ErrorCode" }) +public class DecisionAttributes { + + @JsonProperty("ServiceType") + private String serviceType; + @JsonProperty("VNFType") + private String vNFType; + @JsonProperty("BB_ID") + private String bbID; + @JsonProperty("WorkStep") + private String workStep; + @JsonProperty("ErrorCode") + private String errorCode; + + @JsonProperty("ServiceType") + public String getServiceType() { + return serviceType; + } + + @JsonProperty("ServiceType") + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @JsonProperty("VNFType") + public String getVNFType() { + return vNFType; + } + + @JsonProperty("VNFType") + public void setVNFType(String vNFType) { + this.vNFType = vNFType; + } + + @JsonProperty("BB_ID") + public String getBBID() { + return bbID; + } + + @JsonProperty("BB_ID") + public void setBBID(String bBID) { + this.bbID = bBID; + } + + @JsonProperty("WorkStep") + public String getWorkStep() { + return workStep; + } + + @JsonProperty("WorkStep") + public void setWorkStep(String workStep) { + this.workStep = workStep; + } + + @JsonProperty("ErrorCode") + public String getErrorCode() { + return errorCode; + } + + @JsonProperty("ErrorCode") + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java new file mode 100644 index 0000000000..9a7c21fba1 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/LoggingFilter.java @@ -0,0 +1,109 @@ +package org.openecomp.mso.client.policy; + +import java.io.BufferedInputStream; + +import java.io.ByteArrayOutputStream; +import java.io.FilterOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.logging.Logger; +import javax.annotation.Priority; +import javax.ws.rs.WebApplicationException; +import javax.ws.rs.client.ClientRequestContext; +import javax.ws.rs.client.ClientRequestFilter; +import javax.ws.rs.client.ClientResponseContext; +import javax.ws.rs.client.ClientResponseFilter; +import javax.ws.rs.ext.WriterInterceptor; +import javax.ws.rs.ext.WriterInterceptorContext; + +@Priority(Integer.MIN_VALUE) +public class LoggingFilter implements ClientRequestFilter, ClientResponseFilter, WriterInterceptor { + + private static final Logger logger = Logger.getLogger(LoggingFilter.class.getName()); + private static final String ENTITY_STREAM_PROPERTY = "LoggingFilter.entityStream"; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; + private final int maxEntitySize = 1024 * 8; + + private void log(StringBuilder sb) { + logger.info(sb.toString()); + } + + private InputStream logInboundEntity(final StringBuilder b, InputStream stream, final Charset charset) + throws IOException { + if (!stream.markSupported()) { + stream = new BufferedInputStream(stream); + } + stream.mark(maxEntitySize + 1); + final byte[] entity = new byte[maxEntitySize + 1]; + final int entitySize = stream.read(entity); + b.append(new String(entity, 0, Math.min(entitySize, maxEntitySize), charset)); + if (entitySize > maxEntitySize) { + b.append("...more..."); + } + b.append('\n'); + stream.reset(); + return stream; + } + + @Override + public void filter(ClientRequestContext requestContext) throws IOException { + if (requestContext.hasEntity()) { + final OutputStream stream = new LoggingStream(requestContext.getEntityStream()); + requestContext.setEntityStream(stream); + requestContext.setProperty(ENTITY_STREAM_PROPERTY, stream); + } + } + + @Override + public void filter(ClientRequestContext requestContext, ClientResponseContext responseContext) throws IOException { + final StringBuilder sb = new StringBuilder(); + if (responseContext.hasEntity()) { + responseContext.setEntityStream(logInboundEntity(sb, responseContext.getEntityStream(), DEFAULT_CHARSET)); + log(sb); + } + + } + + @Override + public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { + final LoggingStream stream = (LoggingStream) context.getProperty(ENTITY_STREAM_PROPERTY); + context.proceed(); + if (stream != null) { + log(stream.getStringBuilder(DEFAULT_CHARSET)); + } + } + + private class LoggingStream extends FilterOutputStream { + + private final StringBuilder sb = new StringBuilder(); + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + LoggingStream(OutputStream out) { + super(out); + } + + StringBuilder getStringBuilder(Charset charset) { + // write entity to the builder + final byte[] entity = baos.toByteArray(); + + sb.append(new String(entity, 0, entity.length, charset)); + if (entity.length > maxEntitySize) { + sb.append("...more..."); + } + sb.append('\n'); + + return sb; + } + + @Override + public void write(final int i) throws IOException { + if (baos.size() <= maxEntitySize) { + baos.write(i); + } + out.write(i); + } + } +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecision.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecision.java new file mode 100644 index 0000000000..e0ad170504 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecision.java @@ -0,0 +1,38 @@ + +package org.openecomp.mso.client.policy; + + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "decision", "details" }) +public class PolicyDecision { + + @JsonProperty("decision") + private String decision; + @JsonProperty("details") + private String details; + + @JsonProperty("decision") + public String getDecision() { + return decision; + } + + @JsonProperty("decision") + public void setDecision(String decision) { + this.decision = decision; + } + + @JsonProperty("details") + public String getDetails() { + return details; + } + + @JsonProperty("details") + public void setDetails(String details) { + this.details = details; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecisionRequest.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecisionRequest.java new file mode 100644 index 0000000000..2af91f6638 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyDecisionRequest.java @@ -0,0 +1,38 @@ + +package org.openecomp.mso.client.policy; + + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ "decisionAttributes", "ecompcomponentName" }) +public class PolicyDecisionRequest { + + @JsonProperty("decisionAttributes") + private DecisionAttributes decisionAttributes; + @JsonProperty("ecompcomponentName") + private String ecompcomponentName; + + @JsonProperty("decisionAttributes") + public DecisionAttributes getDecisionAttributes() { + return decisionAttributes; + } + + @JsonProperty("decisionAttributes") + public void setDecisionAttributes(DecisionAttributes decisionAttributes) { + this.decisionAttributes = decisionAttributes; + } + + @JsonProperty("ecompcomponentName") + public String getEcompcomponentName() { + return ecompcomponentName; + } + + @JsonProperty("ecompcomponentName") + public void setEcompcomponentName(String ecompcomponentName) { + this.ecompcomponentName = ecompcomponentName; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java new file mode 100644 index 0000000000..6af1c5dab7 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/PolicyRestClient.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.client.policy; + +import java.util.Map; +import java.util.UUID; + +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.MediaType; + +import org.springframework.stereotype.Service; + +@Service +public class PolicyRestClient extends RestClient { + + private static final String ENDPOINT_KEY = "policy.endpoint"; + private static final String X_ECOMP_REQUESTID = String.valueOf(UUID.randomUUID()); + + public PolicyRestClient() { + super(ENDPOINT_KEY); + } + + @Override + protected void initializeHeaderMap(Map headerMap) { + headerMap.put("ClientAuth", properties.get("policy.client.auth")); + headerMap.put("Authorization", properties.get("policy.auth")); + headerMap.put("Environment", properties.get("policy.environment")); + headerMap.put("X-ECOMP-RequestID", X_ECOMP_REQUESTID); + } + + public PolicyDecision getDecision(String serviceType, String vnfType, String bbID, String workStep, + String errorCode) { + DecisionAttributes decisionAttributes = new DecisionAttributes(); + decisionAttributes.setServiceType(serviceType); + decisionAttributes.setVNFType(vnfType); + decisionAttributes.setBBID(bbID); + decisionAttributes.setWorkStep(workStep); + decisionAttributes.setErrorCode(errorCode); + + return this.getDecision(decisionAttributes); + } + + private PolicyDecision getDecision(DecisionAttributes decisionAttributes) { + PolicyDecisionRequest decisionRequest = new PolicyDecisionRequest(); + decisionRequest.setDecisionAttributes(decisionAttributes); + decisionRequest.setEcompcomponentName(ECOMP_COMPONENT_NAME); + + return this.getBuilder().accept(MediaType.APPLICATION_JSON_TYPE) + .post(Entity.entity(decisionRequest, MediaType.APPLICATION_JSON)).readEntity(PolicyDecision.class); + } +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java new file mode 100644 index 0000000000..f8e1ffd74f --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/policy/RestClient.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.client.policy; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.logging.Logger; + +import javax.ws.rs.client.ClientBuilder; +import javax.ws.rs.client.Invocation.Builder; +import javax.ws.rs.client.WebTarget; + + +import org.openecomp.mso.bpmn.core.PropertyConfiguration; +import org.openecomp.mso.logger.MsoLogger; +import org.springframework.stereotype.Service; + +@Service +public abstract class RestClient { + protected static final String ECOMP_COMPONENT_NAME = "MSO"; + + private WebTarget webTarget; + + protected final Map headerMap; + protected final MsoLogger msoLogger; + protected Map properties; + protected String host; + + protected RestClient(String endpointKey) { + Logger logger = Logger.getLogger(getClass().getName()); + msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); + + properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); + headerMap = new HashMap<>(); + initializeHeaderMap(headerMap); + + host = this.getHost(endpointKey); + + webTarget = ClientBuilder.newClient().register(logger).register(new LoggingFilter()) + .register(new CommonObjectMapperProvider()).target(host); + } + + private String getHost(String key) { + return properties.get(key); + } + + protected Builder getBuilder() { + Builder builder = webTarget.request(); + + for (Entry entry : headerMap.entrySet()) { + builder.header(entry.getKey(), entry.getValue()); + } + return builder; + } + + protected abstract void initializeHeaderMap(Map headerMap); +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java new file mode 100644 index 0000000000..d35d3906f2 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Body.java @@ -0,0 +1,58 @@ + +package org.openecomp.mso.client.sdno; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "input" +}) +public class Body implements Serializable +{ + + @JsonProperty("input") + private Input input; + @JsonIgnore + private Map additionalProperties = new HashMap(); + private final static long serialVersionUID = 9101706044452851559L; + + @JsonProperty("input") + public Input getInput() { + return input; + } + + @JsonProperty("input") + public void setInput(Input input) { + this.input = input; + } + + public Body withInput(Input input) { + this.input = input; + return this; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public Body withAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java new file mode 100644 index 0000000000..da28ac507a --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/Input.java @@ -0,0 +1,58 @@ + +package org.openecomp.mso.client.sdno; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "request-healthdiagnostic" +}) +public class Input implements Serializable +{ + + @JsonProperty("request-healthdiagnostic") + private RequestHealthDiagnostic RequestHealthDiagnostic; + @JsonIgnore + private Map additionalProperties = new HashMap(); + private final static long serialVersionUID = 7155546785389227528L; + + @JsonProperty("request-healthdiagnostic") + public RequestHealthDiagnostic getRequestHealthDiagnostic() { + return RequestHealthDiagnostic; + } + + @JsonProperty("request-healthdiagnostic") + public void setRequestHealthDiagnostic(RequestHealthDiagnostic RequestHealthDiagnostic) { + this.RequestHealthDiagnostic = RequestHealthDiagnostic; + } + + public Input withRequestHealthDiagnostic(RequestHealthDiagnostic RequestHealthDiagnostic) { + this.RequestHealthDiagnostic = RequestHealthDiagnostic; + return this; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public Input withAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java new file mode 100644 index 0000000000..a1109b2dfd --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/RequestHealthDiagnostic.java @@ -0,0 +1,166 @@ + +package org.openecomp.mso.client.sdno; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "request-client-name", + "request-node-name", + "request-node-ip", + "request-id", + "request-user-id", + "request-node-type", + "health-diagnostic-code" +}) +public class RequestHealthDiagnostic implements Serializable +{ + + @JsonProperty("request-client-name") + private String requestClientName; + @JsonProperty("request-node-name") + private String requestNodeName; + @JsonProperty("request-node-ip") + private String requestNodeIp; + @JsonProperty("request-id") + private String requestId; + @JsonProperty("request-user-id") + private String requestUserId; + @JsonProperty("request-node-type") + private String requestNodeType; + @JsonProperty("health-diagnostic-code") + private String healthDiagnosticCode; + @JsonIgnore + private Map additionalProperties = new HashMap(); + private final static long serialVersionUID = 1166788526178388021L; + + @JsonProperty("request-client-name") + public String getRequestClientName() { + return requestClientName; + } + + @JsonProperty("request-client-name") + public void setRequestClientName(String requestClientName) { + this.requestClientName = requestClientName; + } + + public RequestHealthDiagnostic withRequestClientName(String requestClientName) { + this.requestClientName = requestClientName; + return this; + } + + @JsonProperty("request-node-name") + public String getRequestNodeName() { + return requestNodeName; + } + + @JsonProperty("request-node-name") + public void setRequestNodeName(String requestNodeName) { + this.requestNodeName = requestNodeName; + } + + public RequestHealthDiagnostic withRequestNodeName(String requestNodeName) { + this.requestNodeName = requestNodeName; + return this; + } + + @JsonProperty("request-node-ip") + public String getRequestNodeIp() { + return requestNodeIp; + } + + @JsonProperty("request-node-ip") + public void setRequestNodeIp(String requestNodeIp) { + this.requestNodeIp = requestNodeIp; + } + + public RequestHealthDiagnostic withRequestNodeIp(String requestNodeIp) { + this.requestNodeIp = requestNodeIp; + return this; + } + + @JsonProperty("request-id") + public String getRequestId() { + return requestId; + } + + @JsonProperty("request-id") + public void setRequestId(String requestId) { + this.requestId = requestId; + } + + public RequestHealthDiagnostic withRequestId(String requestId) { + this.requestId = requestId; + return this; + } + + @JsonProperty("request-user-id") + public String getRequestUserId() { + return requestUserId; + } + + @JsonProperty("request-user-id") + public void setRequestUserId(String requestUserId) { + this.requestUserId = requestUserId; + } + + public RequestHealthDiagnostic withRequestUserId(String requestUserId) { + this.requestUserId = requestUserId; + return this; + } + + @JsonProperty("request-node-type") + public String getRequestNodeType() { + return requestNodeType; + } + + @JsonProperty("request-node-type") + public void setRequestNodeType(String requestNodeType) { + this.requestNodeType = requestNodeType; + } + + public RequestHealthDiagnostic withRequestNodeType(String requestNodeType) { + this.requestNodeType = requestNodeType; + return this; + } + + @JsonProperty("health-diagnostic-code") + public String getHealthDiagnosticCode() { + return healthDiagnosticCode; + } + + @JsonProperty("health-diagnostic-code") + public void setHealthDiagnosticCode(String healthDiagnosticCode) { + this.healthDiagnosticCode = healthDiagnosticCode; + } + + public RequestHealthDiagnostic withHealthDiagnosticCode(String healthDiagnosticCode) { + this.healthDiagnosticCode = healthDiagnosticCode; + return this; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public RequestHealthDiagnostic withAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java new file mode 100644 index 0000000000..a5199acad7 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/ResultInfo.java @@ -0,0 +1,96 @@ +package org.openecomp.mso.client.sdno; + +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ +"client-name", +"code", +"processing-host", +"request-id", +"status" +}) +public class ResultInfo { + +@JsonProperty("client-name") +private String clientName; +@JsonProperty("code") +private String code; +@JsonProperty("processing-host") +private String processingHost; +@JsonProperty("request-id") +private String requestId; +@JsonProperty("status") +private String status; +@JsonIgnore +private Map additionalProperties = new HashMap(); + +@JsonProperty("client-name") +public String getClientName() { +return clientName; +} + +@JsonProperty("client-name") +public void setClientName(String clientName) { +this.clientName = clientName; +} + +@JsonProperty("code") +public String getCode() { +return code; +} + +@JsonProperty("code") +public void setCode(String code) { +this.code = code; +} + +@JsonProperty("processing-host") +public String getProcessingHost() { +return processingHost; +} + +@JsonProperty("processing-host") +public void setProcessingHost(String processingHost) { +this.processingHost = processingHost; +} + +@JsonProperty("request-id") +public String getRequestId() { +return requestId; +} + +@JsonProperty("request-id") +public void setRequestId(String requestId) { +this.requestId = requestId; +} + +@JsonProperty("status") +public String getStatus() { +return status; +} + +@JsonProperty("status") +public void setStatus(String status) { +this.status = status; +} + +@JsonAnyGetter +public Map getAdditionalProperties() { +return this.additionalProperties; +} + +@JsonAnySetter +public void setAdditionalProperty(String name, Object value) { +this.additionalProperties.put(name, value); +} + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java new file mode 100644 index 0000000000..c634164b59 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNO.java @@ -0,0 +1,94 @@ + +package org.openecomp.mso.client.sdno; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "operation", + "nodeType", + "body" +}) +public class SDNO implements Serializable +{ + + @JsonProperty("operation") + private String operation; + @JsonProperty("nodeType") + private String nodeType; + @JsonProperty("body") + private Body body; + @JsonIgnore + private Map additionalProperties = new HashMap(); + private final static long serialVersionUID = -5303297382564282650L; + + @JsonProperty("operation") + public String getOperation() { + return operation; + } + + @JsonProperty("operation") + public void setOperation(String operation) { + this.operation = operation; + } + + public SDNO withOperation(String operation) { + this.operation = operation; + return this; + } + + @JsonProperty("nodeType") + public String getNodeType() { + return nodeType; + } + + @JsonProperty("nodeType") + public void setNodeType(String nodeType) { + this.nodeType = nodeType; + } + + public SDNO withNodeType(String nodeType) { + this.nodeType = nodeType; + return this; + } + + @JsonProperty("body") + public Body getBody() { + return body; + } + + @JsonProperty("body") + public void setBody(Body body) { + this.body = body; + } + + public SDNO withBody(Body body) { + this.body = body; + return this; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @JsonAnySetter + public void setAdditionalProperty(String name, Object value) { + this.additionalProperties.put(name, value); + } + + public SDNO SDNO (String name, Object value) { + this.additionalProperties.put(name, value); + return this; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java new file mode 100644 index 0000000000..be63feef05 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidator.java @@ -0,0 +1,9 @@ +package org.openecomp.mso.client.sdno; + +import java.io.IOException; + +public interface SDNOValidator { + + void healthDiagnostic(String vnfName, String uuid) throws IOException, Exception; + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java new file mode 100644 index 0000000000..d37e2bc70f --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/sdno/SDNOValidatorImpl.java @@ -0,0 +1,133 @@ +package org.openecomp.mso.client.sdno; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Optional; + +import org.openecomp.mso.client.dmaap.Consumer; +import org.openecomp.mso.client.dmaap.DmaapConsumer; +import org.openecomp.mso.client.dmaap.DmaapPublisher; +import org.openecomp.mso.client.exceptions.SDNOException; +import org.openecomp.mso.jsonpath.JsonPathUtil; + +public class SDNOValidatorImpl implements SDNOValidator, Consumer { + + private final static String aafUserName = "something"; + private final static String clientName = "MSO"; + private final static String healthDiagnosticPath = "body.output.response-healthdiagnostic"; + private final static String producerFilePath = ""; + private String uuid; + private boolean continuePolling = true; + @Override + public void healthDiagnostic(String vnfName, String uuid) { + //Query A&AI data + // setup SDNO Entity + //Call SDNO for Health Diagnostic + //create producer file for MRClient https://wiki.web.att.com/display/MessageRouter/DMaaP_MR_JavaReferenceClient + // final MRBatchingPublisher pub = MRClientFactory.createBatchingPublisher(producerFilePath); + // pub.send("Mypartitionkey",JSON.toString(object)); + //create consumer file for MRClient https://wiki.web.att.com/display/MessageRouter/DMaaP_MR_JavaReferenceClient + //check for error in subscription feed filter via jsonpath + //block and continue to poll waiting for response + } + + protected SDNO buildRequestDiagnostic(String vnfName, String uuid, String oamIp) { + + Input input = new Input(); + SDNO parentRequest = new SDNO(); + Body body = new Body(); + parentRequest.setBody(body); + parentRequest.setNodeType("vPE"); + parentRequest.setOperation("health-diagnostic"); + + body.setInput(input); + + RequestHealthDiagnostic request = new RequestHealthDiagnostic(); + request.setRequestClientName(clientName); + request.setRequestNodeName(vnfName); + request.setRequestNodeIp(oamIp); //generic-vnf oam ip + request.setRequestUserId(aafUserName); //mech id? + request.setRequestId(uuid); //something to identify this request by for polling + + input.setRequestHealthDiagnostic(request); + + return parentRequest; + } + protected void submitRequest(String json) throws FileNotFoundException, IOException, InterruptedException { + DmaapPublisher publisher = new DmaapPublisher(this.producerFilePath); + publisher.send(json); + } + protected boolean pollForResponse(DmaapConsumer consumer, String uuid) throws Exception { + this.uuid = uuid; + return consumer.consume(this); + } + + @Override + public boolean continuePolling() { + return continuePolling; + } + + @Override + public void stopProcessingMessages() { + continuePolling = false; + } + @Override + public void processMessage(String message) throws Exception { + if (isHealthDiagnostic(message, this.getRequestId())) { + if (!healthDiagnosticSuccessful(message)) { + Optional statusMessage = this.getStatusMessage(message); + if (statusMessage.isPresent()) { + throw new SDNOException(statusMessage.get()); + } else { + throw new SDNOException(); + } + } else { + stopProcessingMessages(); + } + } + } + + @Override + public boolean isAccepted(String message) { + if (isResultInfo(message)) { + Optional code = isAccepted(message, this.getRequestId()); + if (code.isPresent()) { + if ("202".equals(code.get())) { + return true; + } else { + //TODO check other statuses 400 and 500 + } + } else { + //TODO throw error + } + } + + return false; + } + + @Override + public String getRequestId() { + return uuid; + } + + protected Optional isAccepted(String json, String uuid) { + return JsonPathUtil.getInstance().locateResult(json, String.format("$.result-info[?(@.status=='ACCEPTED' && @.request-id=='%s')].code", uuid)); + } + + protected boolean isResultInfo(String json) { + return JsonPathUtil.getInstance().pathExists(json, "$[?(@.result-info)]"); + } + + protected boolean isHealthDiagnostic(String json, String uuid) { + return JsonPathUtil.getInstance().pathExists(json, String.format("$[?(@.result-info.request-id=='%s')].%s", uuid, healthDiagnosticPath)); + } + + protected boolean healthDiagnosticSuccessful(String json) { + return JsonPathUtil.getInstance().pathExists(json, "$." + healthDiagnosticPath + "[?(@.response-status=='Success')]"); + } + + protected Optional getStatusMessage(String json) { + return JsonPathUtil.getInstance().locateResult(json, "$." + healthDiagnosticPath + ".response-details-json"); + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/jsonpath/JsonPathUtil.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/jsonpath/JsonPathUtil.java new file mode 100644 index 0000000000..56ce2dfa19 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/jsonpath/JsonPathUtil.java @@ -0,0 +1,39 @@ +package org.openecomp.mso.jsonpath; + +import java.util.Optional; + +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Option; + +import net.minidev.json.JSONArray; + +public class JsonPathUtil { + + + private final Configuration conf; + + private JsonPathUtil() { + conf = Configuration.defaultConfiguration().addOptions(Option.ALWAYS_RETURN_LIST, Option.SUPPRESS_EXCEPTIONS); + } + + private static class Helper { + private static final JsonPathUtil INSTANCE = new JsonPathUtil(); + } + + public static JsonPathUtil getInstance() { + return Helper.INSTANCE; + } + public boolean pathExists(String json, String jsonPath) { + return !JsonPath.using(conf).parse(json).read(jsonPath).isEmpty(); + } + + public Optional locateResult(String json, String jsonPath) { + final JSONArray result = JsonPath.using(conf).parse(json).read(jsonPath); + if (result.isEmpty()) { + return Optional.empty(); + } else { + return Optional.of((T)result.get(0)); + } + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/resources/processengine.properties b/bpmn/MSOCommonBPMN/src/main/resources/processengine.properties deleted file mode 100644 index c21925c23f..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/resources/processengine.properties +++ /dev/null @@ -1,20 +0,0 @@ -### -# ============LICENSE_START======================================================= -# ECOMP MSO -# ================================================================================ -# 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========================================================= -### -processEngineName=common diff --git a/bpmn/MSOCommonBPMN/src/main/resources/processes.xml b/bpmn/MSOCommonBPMN/src/main/resources/processes.xml deleted file mode 100644 index f4f8efdbc4..0000000000 --- a/bpmn/MSOCommonBPMN/src/main/resources/processes.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - org.camunda.bpm.engine.impl.cfg.StandaloneProcessEngineConfiguration - java:jboss/datasources/ProcessEngine - - full - true - true - true - true - - - - - - org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin - - - - - org.camunda.spin.plugin.impl.SpinProcessEnginePlugin - - - - - org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin - - - - org.openecomp.mso.bpmn.core.plugins.LoggingAndURNMappingPlugin - - - - - org.openecomp.mso.bpmn.core.plugins.WorkflowExceptionPlugin - - - - - - - - - - common - - false - true - - - - diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/DecomposeService.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/DecomposeService.bpmn new file mode 100644 index 0000000000..8a89b43cde --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/DecomposeService.bpmn @@ -0,0 +1,142 @@ + + + + + SequenceFlow_1 + + + + SequenceFlow_0tj2l1j + + + + SequenceFlow_0tgrn11 + + + + SequenceFlow_0g4aus9 + + + + SequenceFlow_0tgrn11 + SequenceFlow_0g4aus9 + + + + + + SequenceFlow_12vj619 + SequenceFlow_0tj2l1j + + + + + SequenceFlow_1 + SequenceFlow_0yxffj2 + + + + + + SequenceFlow_0yxffj2 + SequenceFlow_12vj619 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/ManualHandling.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/ManualHandling.bpmn new file mode 100644 index 0000000000..2f30864c39 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/ManualHandling.bpmn @@ -0,0 +1,135 @@ + + + + + SequenceFlow_0jav6cu + + + SequenceFlow_192yimz + + + + SequenceFlow_0tgrn11 + + + + SequenceFlow_0g4aus9 + + + + SequenceFlow_0tgrn11 + SequenceFlow_0g4aus9 + + + + + + + + SequenceFlow_0jav6cu + SequenceFlow_0zgg47r + + + + + + + + + + + + + + + + SequenceFlow_0zgg47r + SequenceFlow_192yimz + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/RainyDayHandler.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/RainyDayHandler.bpmn new file mode 100644 index 0000000000..2638d85a8a --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/BuildingBlock/RainyDayHandler.bpmn @@ -0,0 +1,186 @@ + + + + + SequenceFlow_1 + + + + SequenceFlow_0uwsjoh + SequenceFlow_1f0bjoy + + + + SequenceFlow_0tgrn11 + + + + SequenceFlow_0g4aus9 + + + + SequenceFlow_0tgrn11 + SequenceFlow_0g4aus9 + + + + + + SequenceFlow_1 + SequenceFlow_0yxffj2 + + + + + + SequenceFlow_0yxffj2 + SequenceFlow_12vj619 + + + + SequenceFlow_12vj619 + SequenceFlow_0uwsjoh + SequenceFlow_0navei4 + + + + + + + + + + + + + + + + + + + + + SequenceFlow_0navei4 + SequenceFlow_1f0bjoy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn index cd977e3ae6..2629ea7437 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/CompleteMsoProcess.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_18 @@ -10,25 +10,12 @@ preProcessRequestData.preProcessRequest(execution) ]]> - + SequenceFlow_18 - - SequenceFlow_2 - SequenceFlow_45 - SequenceFlow_46 - - - - - SequenceFlow_45 - SequenceFlow_40 - if_notifcationURLExists - - @@ -47,60 +34,23 @@ preProcessRequestData.preProcessRequest(execution) - - SequenceFlow_7 - SequenceFlow_24 - SequenceFlow_39 - - SequenceFlow_9 - - SequenceFlow_72 + + SequenceFlow_127i45q SequenceFlow_10 - - SequenceFlow_13 - - - - SequenceFlow_46 - SequenceFlow_72 - SequenceFlow_81 - - - - - - - SequenceFlow_25 - SequenceFlow_1q7eer1 - SequenceFlow_13 - Build Error Message @@@@" -import org.openecomp.mso.bpmn.common.scripts.* -def buildDataErrorMessage = new CompleteMsoProcess() -buildDataErrorMessage.buildDataError(execution, "Complete --Update DB status to SUCCESS-- Failed")]]> - - - - SequenceFlow_81 - SequenceFlow_49 - - - - + - ${URN_mso_adapters_db_endpoint} + ${URN_mso_openecomp_adapters_db_endpoint} @@ -119,10 +69,6 @@ completeMsoProcess.updateDBStatusToSuccessPayload(execution)]]> SequenceFlow_6 - - SequenceFlow_1q7eer1 - - SequenceFlow_1 SequenceFlow_0mipf25 @@ -134,78 +80,20 @@ def buildDataErrorMessage = new CompleteMsoProcess() buildDataErrorMessage.buildDataError(execution, "Complete MSO -- Update DB status to SUCCESS -- Failed")]]> - - SequenceFlow_23 - SequenceFlow_24 - SequenceFlow_25 - - - - - SequenceFlow_6 - SequenceFlow_7 SequenceFlow_1 + SequenceFlow_03z8rch - - - - - - - - ${URN_mso_adapters_db_endpoint} - - - - application/soap+xml - #{BasicAuthHeaderValueDB} - - - POST - - ${statusCode} - - soap-http-connector - - - SequenceFlow_49 - SequenceFlow_23 - - SequenceFlow_0mipf25 - - SequenceFlow_40 - SequenceFlow_13qdn1s - SequenceFlow_32 - - - - SequenceFlow_32 - SequenceFlow_39 - SequenceFlow_33 - - - - SequenceFlow_33 - SequenceFlow_17 - Complete MSO Process Done SUCCESSFULLY" -import org.openecomp.mso.bpmn.common.scripts.* -def postProcessResponseData = new CompleteMsoProcess() -postProcessResponseData.postProcessResponse(execution) -println "CompleteMsoProcess Response -->" + "\n" + execution.getVariable("CompletionHandlerResponse")]]> - - - SequenceFlow_17 + SequenceFlow_1pzb94j - @@ -214,13 +102,66 @@ println "CompleteMsoProcess Response -->" + "\n" + execution.getVariable("Comple - if_notifcationURLExists + SequenceFlow_81 SequenceFlow_13qdn1s - - - + + + SequenceFlow_067veaf + SequenceFlow_81 + SequenceFlow_1dptl35 + + + SequenceFlow_1dptl35 + SequenceFlow_13qdn1s + SequenceFlow_1hpvwyt + + + + + + SequenceFlow_2 + SequenceFlow_067veaf + SequenceFlow_0xe5zck + + + SequenceFlow_12he9a1 + SequenceFlow_1hpvwyt + SequenceFlow_1g8ig3h + + + + + SequenceFlow_0xe5zck + SequenceFlow_127i45q + SequenceFlow_1ffkc0n + + + + + + + SequenceFlow_03z8rch + SequenceFlow_1ffkc0n + SequenceFlow_12he9a1 + + + + + + + + + SequenceFlow_1g8ig3h + SequenceFlow_1pzb94j + Complete MSO Process Done SUCCESSFULLY" +import org.openecomp.mso.bpmn.common.scripts.* +def postProcessResponseData = new CompleteMsoProcess() +postProcessResponseData.postProcessResponse(execution) +println "CompleteMsoProcess Response -->" + "\n" + execution.getVariable("CompletionHandlerResponse")]]> + + @@ -228,325 +169,254 @@ println "CompleteMsoProcess Response -->" + "\n" + execution.getVariable("Comple - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - + - - - + + + - + - - + + - + - - - - - + + - - - - - + + - - - - + + - + - - - - - - + + + - + - - - - - - - - - - + + - + - - - - - - - + + + - + - - - + + - + - - - - - + + + + + + + - + - - - - + + + - + - - - - - + + - + - - + + - + - - - - - + + - - - + + + - + - - - - + + + + - + - - - - - - - - + + - - - + + + - + - - - + + + - + - - + + + + + - - + + - + - - - + + + - + - - - - + + + + + - + - - - - - - + + - + - - - + + + - + - - - + + + - + - - - + + + + - + - - + + - + - - - + + + + - + - - + + + + + - + - - - + + + - + - - - - - - + + + + - + - - - - + + + + - + - - - - + + + + + - + - - - - - - - + + + + - + - - - - - - - - - - - + + + + + + - + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn index 75e05cb58e..4ac34f9210 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_12 @@ -133,7 +133,7 @@ falloutHandler.buildDBWorkflowException(execution, "FH_updateRequestInfraRespons - ${URN_mso_adapters_db_endpoint} + ${URN_mso_openecomp_adapters_db_endpoint} POST @@ -207,7 +207,7 @@ execution.setVariable("FH_WorkflowException", wfe)]]> - + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn index e0fc14e933..6a4223d2ad 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_15 @@ -129,12 +129,12 @@ sdnc.resetCallbackRequest(execution)]]> Done SequenceFlow_30 - + - Done + SequenceFlow_1w1za5m SequenceFlow_17 SequenceFlow_21 SequenceFlow_26 - + @@ -177,20 +177,12 @@ sdnc.assignError(execution)]]> SequenceFlow_27 - - SequenceFlow_21 - SequenceFlow_31 - - - - SequenceFlow_31 + SequenceFlow_21 SequenceFlow_4 SequenceFlow_23 - + @@ -210,15 +202,32 @@ sdnc.toggleSuccessIndicator(execution)]]> - + - SequenceFlow_4 + SequenceFlow_193cb6p + SequenceFlow_1em7gys + + SequenceFlow_4 + SequenceFlow_193cb6p + + + + + SequenceFlow_1em7gys + + + + Done + SequenceFlow_1w1za5m + + + @@ -243,9 +252,9 @@ sdnc.toggleSuccessIndicator(execution)]]> - + - + @@ -376,9 +385,9 @@ sdnc.toggleSuccessIndicator(execution)]]> - + - + @@ -401,16 +410,16 @@ sdnc.toggleSuccessIndicator(execution)]]> - + - + - - + + - + @@ -420,23 +429,24 @@ sdnc.toggleSuccessIndicator(execution)]]> - - + + - + - + - + - - + + + - + @@ -448,13 +458,13 @@ sdnc.toggleSuccessIndicator(execution)]]> - + - - + + - + @@ -489,18 +499,6 @@ sdnc.toggleSuccessIndicator(execution)]]> - - - - - - - - - - - - @@ -543,8 +541,41 @@ sdnc.toggleSuccessIndicator(execution)]]> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xjb/AAI.xjb b/bpmn/MSOCommonBPMN/src/main/resources/xjb/AAI.xjb new file mode 100644 index 0000000000..ca8ac4766d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/xjb/AAI.xjb @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd new file mode 100644 index 0000000000..e743dc754e --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MSOWorkflowSchemaV1.xsd @@ -0,0 +1,137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/ManualTasks.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/ManualTasks.xsd new file mode 100644 index 0000000000..f1754b6ba7 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/ManualTasks.xsd @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd new file mode 100644 index 0000000000..ce92a4909b --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/MsoServiceRequestTypesV1.xsd @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + order-number is required if service-type equals SDN-ETHERNET-INTERNET. order-version is required if service-type equals + SDN-ETHERNET-INTERNET, source=OMX, and request-action=Layer3ServiceActivateRequest or ChangeLayer3ServiceProvRequest + + + + + + + + + + + + + + + + subscriber-name required if request-action=Layer3ServiceActivateRequest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v10.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v10.xsd new file mode 100644 index 0000000000..0972056432 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v10.xsd @@ -0,0 +1,6547 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="The specific type of node in the A&AI graph") + + + + + + + @com.att.aai.annotations.Metadata(description="The URL to the specific resource") + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="A keyword provided by A&AI to indicate an attribute.") + + + + + + + @com.att.aai.annotations.Metadata(description="Value of the attribute.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Key part of a key/value pair") + + + + + + + @com.att.aai.annotations.Metadata(description="Value part of a key/value pair") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="A keyword provided by A&AI to indicate type of node.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to the object in A&AI.") + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="OAM network, to be deprecated shortly. Do not use for new purposes. ",nameProps="network-name",indexedProps="cvlan-tag,network-uuid,network-name",dependentOn="cloud-region",container="oam-networks") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="UUID of the network. Unique across a cloud-region") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the network.") + + + + + + + @com.att.aai.annotations.Metadata(description="cvlan-id") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for VNF firewall rule so customer cannot send customer traffic over this oam network") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for VNF firewall rule so customer cannot send customer traffic over this oam network") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of OAM networks, to be deprecated shortly. Do not use for new purposes. ") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Digital virtual switch metadata, used by SDN-C to configure VCEs. A&AI needs to receive this data from the PO deployment team and administer it using the provisioningTool.sh into A&AI. ",indexedProps="vcenter-url,switch-name",dependentOn="cloud-region",container="dvs-switches") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="DVS switch name") + + + + + + + @com.att.aai.annotations.Metadata(description="URL used to reach the vcenter") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of digital virtual switch metadata used for vmWare VCEs and VPEs.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Availability zone, a collection of compute hosts/pservers",indexedProps="availability-zone-name",dependentOn="cloud-region",container="availability-zones") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Name of the availability zone. Unique across a cloud region") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of hypervisor. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Serves a PATCH like function. Does not enforce concurrency control. Clear each usage with AAI team.") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="APIs that are more action related than REST (e.g., notify, update).") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="A collection of C tags (vlan tags) grouped for a specific purpose.",indexedProps="availability-zone-name",dependentOn="complex",container="ctag-pools") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="The Target provider edge router") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Name of the availability zone") + + + + + + + @com.att.aai.annotations.Metadata(description="Describes what the intended purpose of this pool is.") + + + + + + + @com.att.aai.annotations.Metadata(description="Comma separated list of ctags") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of physical locations that can house cloud-regions.",indexedProps="identity-url,data-center-code,complex-name,physical-location-id",searchable="physical-location-id,data-center-code,complex-name,street1,street2,postal-code",uniqueProps="physical-location-id",container="complexes",namespace="cloud-infrastructure") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique identifier for physical location, e.g., CLLI") + + + + + + + @com.att.aai.annotations.Metadata(description="Data center code which can be an alternate way to identify a complex") + + + + + + + @com.att.aai.annotations.Metadata(description="Gamma complex name for LCP instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL of the keystone identity service") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Type, e.g., central office, data center.") + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of physical locations that can house cloud-regions.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Persistent block-level storage.",indexedProps="volume-group-name,vnf-type,heat-stack-id,volume-group-id",searchable="volume-group-id,volume-group-name",dependentOn="cloud-region",container="volume-groups") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of volume-group.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the volume group.") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this volume-group") + + + + + + + @com.att.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this volume-group") + + + + + + + @com.att.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @com.att.aai.annotations.Metadata(description="helps relate the volume group to the vf-module whose components will require the volume group") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of persistent block-level storage.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Ephemeral Block storage volume.",indexedProps="volume-id",dependentOn="vserver",container="volumes") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of block storage volume relative to the vserver.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of ephemeral Block storage volumes.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="IPv4 Address Range",indexedProps="l3-interface-ipv4-address,vlan-id-inner,neutron-network-id,neutron-subnet-id",dependentOn="vlan,l-interface") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="IP address") + + + + + + + @com.att.aai.annotations.Metadata(description="Prefix length, 32 for single address") + + + + + + + @com.att.aai.annotations.Metadata(description="Inner VLAN tag") + + + + + + + @com.att.aai.annotations.Metadata(description="Outer VLAN tag") + + + + + + + @com.att.aai.annotations.Metadata(description="Indicator of fixed or floating address") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron network id of the interface that address belongs to") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron id of subnet that address belongs to") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="IPv6 Address Range",indexedProps="l3-interface-ipv6-address,vlan-id-inner,neutron-network-id,neutron-subnet-id",dependentOn="vlan,l-interface") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="IP address") + + + + + + + @com.att.aai.annotations.Metadata(description="Prefix length, 128 for single address") + + + + + + + @com.att.aai.annotations.Metadata(description="Inner VLAN tag") + + + + + + + @com.att.aai.annotations.Metadata(description="Outer VLAN tag") + + + + + + + @com.att.aai.annotations.Metadata(description="Indicator of fixed or floating address") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron network id of the interface that address belongs to") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron id of subnet that address belongs to") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Definition of vlan",indexedProps="vlan-interface,vlan-id-inner,vpn-id",uniqueProps="vpn-id",dependentOn="l-interface",container="vlans") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="String that identifies the interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Inner VLAN tag") + + + + + + + @com.att.aai.annotations.Metadata(description="Outer VLAN tag") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Used to describe (the service associated with) the vlan") + + + + + + + @com.att.aai.annotations.Metadata(description="Whether customer is going to use this VLAN for backdoor connection to another customer premise device.") + + + + + + + @com.att.aai.annotations.Metadata(description="This indicates the customers VPN ID associated with this vlan") + + + + + + + @com.att.aai.annotations.Metadata(description="Status of a vnf's vlan interface, on which the customer circuit resides, mastered by SDN-C.") + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="SR-IOV Virtual Function (not to be confused with virtual network function)",indexedProps="pci-id,vf-vlan-filter,vf-mac-filter,vf-vlan-strip,neutron-network-id",dependentOn="l-interface",container="sriov-vfs") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="PCI ID used to identify the sriov-vf") + + + + + + + @com.att.aai.annotations.Metadata(description="This metadata provides option to specify list of VLAN filters applied on VF to pass the traffic to VM.") + + + + + + + @com.att.aai.annotations.Metadata(description="When MAC filters are specified, VF-agent service configures VFs to do MAC level filtering before the traffic is passed to VM.") + + + + + + + @com.att.aai.annotations.Metadata(description="When this field is set to true, VF will configured to strip the outer TAG before the traffic is passed to VM.") + + + + + + + @com.att.aai.annotations.Metadata(description="This option ensures anti VLAN spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs.") + + + + + + + @com.att.aai.annotations.Metadata(description="This option ensures anti MAC spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs.") + + + + + + + @com.att.aai.annotations.Metadata(description="This option defines the set of Mirror objects which essentially mirrors the traffic from source to set of collector VNF Ports.") + + + + + + + @com.att.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows all broadcast traffic to reach the VM") + + + + + + + @com.att.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows unknown multicast traffic to reach the VM") + + + + + + + @com.att.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows unknown unicast traffic to reach the VM") + + + + + + + @com.att.aai.annotations.Metadata(description="This option, if set to true, instructs to insert outer tag after traffic comes out of VM.") + + + + + + + @com.att.aai.annotations.Metadata(description="This option is used to set the link status. Valid values as of 1607 are on, off, and auto.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron network id of the interface") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of SR-IOV Virtual Functions.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Logical interfaces, e.g., a vnic.",indexedProps="macaddr,interface-id,interface-name,network-name",dependentOn="generic-vnf,newvce,vpe,p-interface,vserver,lag-interface",container="l-interfaces") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Name given to the interface") + + + + + + + @com.att.aai.annotations.Metadata(description="E.g., CUSTOMER, UPLINK, etc.") + + + + + + + @com.att.aai.annotations.Metadata(description="Questionably placed - v6 ip addr of this interface (is in vr-lan-interface from Mary B.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="ID of interface") + + + + + + + @com.att.aai.annotations.Metadata(description="MAC address for the interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the network") + + + + + + + @com.att.aai.annotations.Metadata(description="Whether A&AI should be managing this interface of not. Could have value like CUSTOMER") + + + + + + + @com.att.aai.annotations.Metadata(description="Human friendly text regarding this interface.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this port is mirrored.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of logical interfaces.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Virtual Servers, aka virtual machine or VM.",nameProps="vserver-name",indexedProps="is-closed-loop-disabled,prov-status,vserver-name,vserver-id,in-maint,vserver-name2",searchable="vserver-id,vserver-name,vserver-name2",dependentOn="tenant",container="vservers") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique identifier for this vserver relative to its tenant") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of vserver") + + + + + + + @com.att.aai.annotations.Metadata(description="Alternative name of vserver") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether closed loop function is enabled on this node") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of virtual Servers, aka virtual machines or VMs.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack tenant",nameProps="tenant-name",indexedProps="tenant-name,tenant-id",searchable="tenant-id,tenant-name",dependentOn="cloud-region",container="tenants") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id relative to the cloud-region.") + + + + + + + @com.att.aai.annotations.Metadata(description="Readable name of tenant") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack tenants.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack flavor.",nameProps="flavor-name",indexedProps="flavor-name,flavor-id",dependentOn="cloud-region",container="flavors") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Flavor id, expected to be unique across cloud-region.") + + + + + + + @com.att.aai.annotations.Metadata(description="Flavor name") + + + + + + + @com.att.aai.annotations.Metadata(description="Number of CPUs") + + + + + + + @com.att.aai.annotations.Metadata(description="Amount of memory") + + + + + + + @com.att.aai.annotations.Metadata(description="Disk space") + + + + + + + @com.att.aai.annotations.Metadata(description="Amount of ephemeral disk space") + + + + + + + @com.att.aai.annotations.Metadata(description="amount of swap space allocation") + + + + + + + @com.att.aai.annotations.Metadata(description="whether flavor is available to all users or private to the tenant it was created in.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="Boolean as to whether this flavor is no longer enabled") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack flavors.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack group-assignment used to store exclusivity groups (EG).",nameProps="group-name",indexedProps="group-id,group-type,group-name",dependentOn="cloud-region",container="group-assignments") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Group id, expected to be unique across cloud-region.") + + + + + + + @com.att.aai.annotations.Metadata(description="Group type - the type of group this instance refers to") + + + + + + + @com.att.aai.annotations.Metadata(description="Group name - name assigned to the group") + + + + + + + @com.att.aai.annotations.Metadata(description="Group description - description of the group") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack group assignments") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack snapshot",nameProps="snapshot-name",uniqueProps="snapshot-id",indexedProps="application,snapshot-name,application-vendor,snapshot-id,application-version,prev-snapshot-id",dependentOn="cloud-region",container="snapshots") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Snapshot id, this is the key UUID assoc associated in glance with the snapshots.") + + + + + + + @com.att.aai.annotations.Metadata(description="Snapshot name") + + + + + + + @com.att.aai.annotations.Metadata(description="Operating system architecture") + + + + + + + @com.att.aai.annotations.Metadata(description="The common name of the operating system distribution in lowercase") + + + + + + + @com.att.aai.annotations.Metadata(description="The operating system version as specified by the distributor.") + + + + + + + @com.att.aai.annotations.Metadata(description="The application that the image instantiates.") + + + + + + + @com.att.aai.annotations.Metadata(description="The vendor of the application.") + + + + + + + @com.att.aai.annotations.Metadata(description="The version of the application.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="This field contains the UUID of the previous snapshot (if any).") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack snapshots") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Key/value pairs",indexedProps="metaname",dependentOn="tenant,image,service-instance,connector,model",container="metadata") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true) + + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of metadatum (key/value pairs)") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack image.",nameProps="image-name",indexedProps="application,image-name,application-vendor,image-id,application-version",dependentOn="cloud-region",container="images") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Image id, expected to be unique across cloud region") + + + + + + + @com.att.aai.annotations.Metadata(description="Image name") + + + + + + + @com.att.aai.annotations.Metadata(description="Operating system architecture.") + + + + + + + @com.att.aai.annotations.Metadata(description="The common name of the operating system distribution in lowercase") + + + + + + + @com.att.aai.annotations.Metadata(description="The operating system version as specified by the distributor.") + + + + + + + @com.att.aai.annotations.Metadata(description="The application that the image instantiates.") + + + + + + + @com.att.aai.annotations.Metadata(description="The vendor of the application.") + + + + + + + @com.att.aai.annotations.Metadata(description="The version of the application.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collectio of Openstack images.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of availability zones") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="cloud-region designates an installation of a cloud cluster or region or instantiation. In AT&Ts AIC cloud, this could be an LCP or DCP. Cloud regions are uniquely identified by a composite key, cloud-owner + cloud-region-id. The format of the cloud-owner is vendor-cloudname and we will use att-aic for AT&T's AIC. It's important to note that the cloud-region data is not updated once created, so there is a potential for the data to become stale.",indexedProps="cloud-owner,cloud-region-id,cloud-type,owner-defined-type",nameProps="owner-defined-type",container="cloud-regions",namespace="cloud-infrastructure") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Identifies the vendor and cloud name, e.g., att-aic. First part of composite key should be formatted as vendor-cloudname") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Identifier used by the vendor for the region. Second part of composite key") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of the cloud (e.g., openstack)") + + + + + + + @com.att.aai.annotations.Metadata(description="Cloud-owner defined type indicator (e.g., dcp, lcp)") + + + + + + + @com.att.aai.annotations.Metadata(description="Software version employed at the site. NOTE - THIS FIELD IS NOT KEPT UP TO DATE.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL of the keystone identity service") + + + + + + + @com.att.aai.annotations.Metadata(description="Zone where the cloud is homed. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED.") + + + + + + + @com.att.aai.annotations.Metadata(description="complex name for cloud-region instance. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(maximumDepth="0") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Network profile populated by SDN-GP for SNMP",indexedProps="nm-profile-name",container="network-profiles",namespace="cloud-infrastructure") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique name of network profile.") + + + + + + + @com.att.aai.annotations.Metadata(description="Encrypted SNMP community string") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of network profiles") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Physical interface (e.g., nic)",indexedProps="interface-name,prov-status",nameProps="prov-status",dependentOn="vpls-pe,pserver,pnf",container="p-interfaces") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Name that identifies the physical interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Nature of the services and connectivity on this port.") + + + + + + + @com.att.aai.annotations.Metadata(description="CLEI or other specification for p-interface hardware.") + + + + + + + @com.att.aai.annotations.Metadata(description="Role specification for p-interface hardware.") + + + + + + + @com.att.aai.annotations.Metadata(description="Indicates the physical properties of the interface.") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of physical interfaces.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Link aggregate interface",indexedProps="interface-name,interface-id,interface-role",dependentOn="generic-vnf,pserver,vpe,vpls-pe,pnf",container="lag-interfaces") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Name that identifies the link aggregate interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Human friendly text regarding this interface.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="ID of interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Role assigned to this Interface, should use values as defined in ECOMP Yang models.") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of link aggregate interfaces.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Compute host whose hostname must be unique and must exactly match what is sent as a relationship to a vserver.",nameProps="pserver-name2",indexedProps="hostname,in-maint,pserver-id,pserver-name2,inv-status",searchable="hostname,pserver-name2,pserver-id,ipv4-oam-address",container="pservers",namespace="cloud-infrastructure") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Value from executing hostname on the compute node.") + + + + + + + @com.att.aai.annotations.Metadata(description="PTNII name") + + + + + + + @com.att.aai.annotations.Metadata(description="Number of cpus") + + + + + + + @com.att.aai.annotations.Metadata(description="Disk size, in GBs") + + + + + + + @com.att.aai.annotations.Metadata(description="RAM size, in MBs") + + + + + + + @com.att.aai.annotations.Metadata(description="Equipment type. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="Equipment vendor. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="Equipment model. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="Fully-qualified domain name") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="Used to configure device, also used for troubleshooting and is IP used for traps generated by device.") + + + + + + + @com.att.aai.annotations.Metadata(description="Serial number, may be queried") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV4 Loopback 0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV6 Loopback 0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV4 AIM address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV6 AIM address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV6 OAM address") + + + + + + + @com.att.aai.annotations.Metadata(description="CANOPI's inventory status. Only set with values exactly as defined by CANOPI.") + + + + + + + @com.att.aai.annotations.Metadata(description="ID of Pserver") + + + + + + + @com.att.aai.annotations.Metadata(description="internet topology of Pserver") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="alternative pserver name") + + + + + + + @com.att.aai.annotations.Metadata(description="purpose of pserver") + + + + + + + @com.att.aai.annotations.Metadata(description="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]") + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of compute hosts.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Virtual organization of cloud infrastructure elements in a data center context",nameProps="vdc-name",indexedProps="vdc-name,vdc-id",container="virtual-data-centers",namespace="cloud-infrastructure") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of the vdc") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the virtual data center") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Virtual organization of cloud infrastructure elements in a data center context") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Namespace for cloud infrastructure.") + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of resource instances used to connect a variety of disparate inventory widgets",indexedProps="resource-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version",container="connectors",namespace="business") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of resource instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of resource instances used to connect a variety of disparate inventory widgets") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Represents the specifics of a tunnel cross connect piece of a resource that gets separately allotted",uniqueProps="id",indexedProps="id",dependentOn="allotted-resource",container="tunnel-xconnects") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Allotted Resource id UUID assigned to this instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="The WAN uplink bandwidth for WAN1") + + + + + + + @com.att.aai.annotations.Metadata(description="The WAN downlink bandwidth for WAN1") + + + + + + + @com.att.aai.annotations.Metadata(description="The WAN uplink bandwidth for WAN2") + + + + + + + @com.att.aai.annotations.Metadata(description="The WAN downlink bandwidth for WAN2") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This object is used to store the specific tunnel cross connect aspects of an allotted resource") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Represents a slice or partial piece of a resource that gets separately allotted",nameProps="description",uniqueProps="id",indexedProps="id,model-invariant-id,model-version-id,type,role",dependentOn="service-instance",container="allotted-resources") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Allotted Resource id UUID assigned to this instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="The descriptive information assigned to this allotted resource instance") + + + + + + + @com.att.aai.annotations.Metadata(description="Link back to more information in the controller") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this resource, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + @com.att.aai.annotations.Metadata(description="Generic description of the type of the resource") + + + + + + + @com.att.aai.annotations.Metadata(description="Role that this asset will be playing in its context.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This object is used to store slices of services being offered") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Instance of a service",indexedProps="service-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,service-instance-name,service-instance-location-id,orchestration-status",nameProps="service-instance-name",searchable="service-instance-id,service-instance-name",uniqueProps="service-instance-id",dependentOn="service-subscription",container="service-instances") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Uniquely identifies this instance of a service") + + + + + + + @com.att.aai.annotations.Metadata(description="This field will store a name assigned to the service-instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="Indicates the total bandwidth to be used for this service.") + + + + + + + @com.att.aai.annotations.Metadata(description="indicates the upstream bandwidth this service will use on the WAN1 port of the physical device.") + + + + + + + @com.att.aai.annotations.Metadata(description="indicates the downstream bandwidth this service will use on the WAN1 port of the physical device.") + + + + + + + @com.att.aai.annotations.Metadata(description="indicates the upstream bandwidth this service will use on the WAN2 port of the physical device.") + + + + + + + @com.att.aai.annotations.Metadata(description="indicates the downstream bandwidth this service will use on the WAN2 port of the physical device.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL customers will use to access the vHN Portal.") + + + + + + + @com.att.aai.annotations.Metadata(description="An identifier that customers assign to the location where this service is being used.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this service.") + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of service instances") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Object that group service instances.",indexedProps="service-type",dependentOn="customer",container="service-subscriptions",crossEntityReference="service-instance,service-type") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Value defined by orchestration to identify this service across ECOMP.") + + + + + + + @com.att.aai.annotations.Metadata(description="This property will be deleted from A&AI in the near future. Only stop gap solution.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of objects that group service instances.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="customer identifiers to provide linkage back to BSS information.",nameProps="subscriber-name",indexedProps="subscriber-name,global-customer-id,subscriber-type",searchable="global-customer-id,subscriber-name",uniqueProps="global-customer-id",container="customers",namespace="business") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Global customer id used across ECOMP to uniquely identify customer.") + + + + + + + @com.att.aai.annotations.Metadata(description="Subscriber name, an alternate way to retrieve a customer.") + + + + + + + @com.att.aai.annotations.Metadata(description="Subscriber type, a way to provide VID with only the INFRA customers.",defaultValue="CUST") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of customer identifiers to provide linkage back to BSS information.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Namespace for business related constructs") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Image object that pertain to a VNF that doesn't have associated vservers. This is a kludge.",indexedProps="application,att-uuid,application-vendor,application-version",uniqueProps="att-uuid",container="vnf-images",namespace="service-design-and-creation") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of this asset") + + + + + + + @com.att.aai.annotations.Metadata(description="The application that the image instantiates.") + + + + + + + @com.att.aai.annotations.Metadata(description="The vendor of the application.") + + + + + + + @com.att.aai.annotations.Metadata(description="The version of the application.") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of image objects that pertain to a VNF that doesn't have associated vservers. This is a kludge.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Stand-in for service model definitions. Likely to be deprecated in favor of models from ASDC. Does not strictly map to ASDC services.",indexedProps="service-description,service-id",container="services",namespace="service-design-and-creation") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="This gets defined by others to provide a unique ID for the service, we accept what is sent.") + + + + + + + @com.att.aai.annotations.Metadata(description="Description of the service") + + + + + + + @com.att.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="service version") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of service model definitions. Likely to be deprecated in favor of models from ASDC.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Early definition of server/resource pairings, likely to be replaced by models. No new use should be made of this.",indexedProps="service-type,vnf-type",container="service-capabilities",namespace="service-design-and-creation") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="This gets defined by others to provide a unique ID for the service, we accept what is sent.") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of service capabilities.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="element-choice-set-uuid",indexedProps="element-choice-set-uuid",allowDirectRead="true",allowDirectWrite="false",container="element-choice-sets") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="constrained-element-set-uuid",indexedProps="constrained-element-set-uuid",allowDirectRead="true",allowDirectWrite="false",container="constrained-element-sets") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="model-constraint-uuid",indexedProps="model-constraint-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-constraints") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model.",uniqueProps="model-element-uuid",indexedProps="model-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-elements") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + @com.att.aai.annotations.Metadata(description="Indicates whether this element was created as part of instantiation from this model") + + + + + + + @com.att.aai.annotations.Metadata(description="How many of this type of element are required/allowed") + + + + + + + + @com.att.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model.",uniqueProps="model-element-uuid",indexedProps="model-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-elements") + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model") + + + + + + + @com.att.aai.annotations.Metadata(description="Describes new constraints on this model element that are not part of that model's definition") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Subgraph definition provided by ASDC to describe a specific version of an inventory asset and its connections related to ASDC models",nameProps="model-name",indexedProps="model-version-id,model-name,model-version",uniqueProps="model-version-id",container="model-vers") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to one version of a model in ASDC") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the model, which can change from version to version.") + + + + + + + @com.att.aai.annotations.Metadata(description="Version") + + + + + + + @com.att.aai.annotations.Metadata(description="Description") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Subgraph definition provided by ASDC to describe an inventory asset and its connections related to ASDC models, independent of version",nameProps="model-type",indexedProps="model-invariant-id,model-type",uniqueProps="model-invariant-id",container="models",namespace="service-design-and-creation") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to the main definition of a model in ASDC") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of the model, e.g., service, resource, widget, etc.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of subgraph definitions provided by ASDC to describe the inventory assets and their connections related to ASDC models") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="TBD",uniqueProps="related-lookup-uuid",indexedProps="related-lookup-uuid",allowDirectRead="true",allowDirectWrite="false",container="related-lookups") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="TBD",uniqueProps="property-constraint-uuid",indexedProps="property-constraint-uuid",allowDirectRead="true",allowDirectWrite="false",container="property-constraints") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="TBD",uniqueProps="named-query-element-uuid",indexedProps="named-query-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="named-query-elements") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="TBD",nameProps="named-query-name",uniqueProps="named-query-uuid",indexedProps="named-query-uuid,named-query-name",container="named-queries",namespace="service-design-and-creation") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true) + + + + + + + + + + @com.att.aai.annotations.Metadata(description="TBD",nameProps="named-query-name",uniqueProps="named-query-uuid",indexedProps="named-query-uuid,named-query-name",container="named-queries",namespace="service-design-and-creation") + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Namespace for objects managed by ASDC") + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Logical links generally connect l-interfaces but are used to express logical connectivity between two points",indexedProps="link-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,link-id,prov-status,circuit-id,purpose",uniqueProps="link-id",container="logical-links",namespace="network",searchable="link-name") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="e.g., evc-name, or vnf-nameA_interface-nameA_vnf-nameZ_interface-nameZ") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of logical link, e.g., evc") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="v4, v6, or ds for dual stack (should be att-ip-version)") + + + + + + + @com.att.aai.annotations.Metadata(description="For example, static or BGP") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Indication of the network use of the logical link.") + + + + + + + @com.att.aai.annotations.Metadata(description="Alias or alternate name (CLCI or D1 name).") + + + + + + + @com.att.aai.annotations.Metadata(description="UUID of the logical-link, SDNC generates this.") + + + + + + + @com.att.aai.annotations.Metadata(description="Circuit id") + + + + + + + @com.att.aai.annotations.Metadata(description="Reason for this entity, role it is playing") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of logical connections") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="cos",dependentOn="site-pair",container="classes-of-service") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="unique identifier of probe") + + + + + + + @com.att.aai.annotations.Metadata(description="identifier of probe") + + + + + + + @com.att.aai.annotations.Metadata(description="type of probe") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="class-of-service of probe") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="site-pair-id",uniqueProps="site-pair-id",dependentOn="routing-instance",container="site-pairs") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="unique identifier of probe") + + + + + + + @com.att.aai.annotations.Metadata(description="Prefix address") + + + + + + + @com.att.aai.annotations.Metadata(description="Prefix address") + + + + + + + @com.att.aai.annotations.Metadata(description="ip version, v4, v6") + + + + + + + @com.att.aai.annotations.Metadata(description="Hostname of the destination equipment to which SLAs are measured against.") + + + + + + + @com.att.aai.annotations.Metadata(description="The type of destinatination equipment. Could be Router, UCPE, etc.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="probe within a set") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="routing-instance-id",uniqueProps="routing-instance-id",dependentOn="site-pair-set",container="routing-instances") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of routing instance") + + + + + + + @com.att.aai.annotations.Metadata(description="rpm owner") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="set of probes related to generic-vnf routing instance") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Set of instances for probes used to measure service level agreements",indexedProps="site-pair-set-id",uniqueProps="site-pair-set-id",container="site-pair-sets",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of site pair set.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of sets of instances for probes related to generic-vnf") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="stores the global route targets associated with a VPN",indexedProps="global-route-target,route-target-role",searchable="global-route-target",container="route-targets",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Number used to identify an RT, globally unique in the network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Role assigned to this route target, valid values EXPORT/IMPORT/BOTH") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Relationship to other objects") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="VPN binding",nameProps="vpn-name,vpn-type",indexedProps="vpn-name,vpn-id,global-route-target,vpn-type",searchable="vpn-id,vpn-name",uniqueProps="vpn-id",container="vpn-bindings",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="VPN ID, globally unique within A&AI") + + + + + + + @com.att.aai.annotations.Metadata(description="VPN Name") + + + + + + + @com.att.aai.annotations.Metadata(description="Number used to identify a VPN, globally unique in the network. NOTE - WILL BE RETIRED IN 1802, see child object") + + + + + + + @com.att.aai.annotations.Metadata(description="the platform associated with the VPN example AVPN, Mobility") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of the vpn, should be taken from enumerated/valid values") + + + + + + + @com.att.aai.annotations.Metadata(description="Used to distinguish the distinct VPN routes of separate customers who connect to the provider in an MPLS network.") + + + + + + + @com.att.aai.annotations.Metadata(description="Role assigned to this route target. NOTE - WILL BE RETIRED IN 1802, see child object") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + @com.att.aai.annotations.Metadata(description="l3-networks relate to vpn-bindings") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="VPLS Provider Edge routers.",indexedProps="prov-status,equipment-name",container="vpls-pes",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true) + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).") + + + + + + + @com.att.aai.annotations.Metadata(description="Client should send valid enumerated value, e.g., VPLS-PE.") + + + + + + + @com.att.aai.annotations.Metadata(description="Temporary location for stag to get to VCE") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of VPLS Provider Edge routers") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="multicast-configuration-id",uniqueProps="multicast-configuration-id",container="multicast-configurations",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of multicast configuration.") + + + + + + + @com.att.aai.annotations.Metadata(description="protocol of multicast configuration") + + + + + + + @com.att.aai.annotations.Metadata(description="rp type of multicast configuration") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="multicast configuration of generic-vnf ip-address") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(dependentOn="port-group",indexedProps="cvlan-tag",container="cvlan-tags") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="See mis-na-virtualization-platform.yang") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Used to capture the network interfaces of this VCE",nameProps="port-group-name",indexedProps="port-group-id,heat-stack-id,interface-id,interface-name,switch-name",dependentOn="vce",container="port-groups") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of the interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron network id of this Interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron network name of this Interface") + + + + + + + @com.att.aai.annotations.Metadata(description="Role assigned to this Interface, should use values as defined in ECOMP Yang models.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Unique ID for port group in vmware") + + + + + + + @com.att.aai.annotations.Metadata(description="Likely to duplicate value of neutron network name") + + + + + + + @com.att.aai.annotations.Metadata(description="DVS or standard switch name (should be non-null for port groups associated with DVS)") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Metadata for license group.",indexedProps="group-uuid,resource-uuid",dependentOn="generic-vnf,vce,vpe",container="licenses") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID for the license group the resource belongs to, should be uuid.") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of a license resource. ") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Licenses to be allocated across resources, keyed by group-uuid and resource-uuid, related to license management") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Metadata for entitlement group.",indexedProps="group-uuid,resource-uuid",dependentOn="generic-vnf,vce,vpe",container="entitlements") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID for the entitlement group the resource comes from, should be uuid.") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of an entitlement resource. ") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Entitlements, keyed by group-uuid and resource-uuid, related to license management") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Virtual Customer Edge Router, used specifically for Gamma. This object is deprecated.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,interface-name,regional-resource-zone,vpe-id,prov-status,service-id",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="vces",namespace="network",extendsFrom="vnf") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @com.att.aai.annotations.Metadata(description="Unique identifier of service, does not strictly map to ASDC services, SOON TO BE DEPRECATED.") + + + + + + + @com.att.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Network role being played by this VNF") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @com.att.aai.annotations.Metadata(description="Unique ID of VPE connected to this VCE.") + + + + + + + @com.att.aai.annotations.Metadata(description="Valid v6 IP address for the WAN Link on this router. Implied length of /64.") + + + + + + + @com.att.aai.annotations.Metadata(description="Address tail-f uses to configure vce, also used for troubleshooting and is IP used for traps generated by VCE.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Loopback0 address") + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of Virtual Customer Edge Routers, used specifically for Gamma. This object is deprecated.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Relationship-list must include related to info for complex.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,regional-resource-zone,prov-status,service-id",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="vpes",namespace="network",extendsFrom="vnf") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @com.att.aai.annotations.Metadata(description="Unique identifier of service. Does not map strictly to ASDC services. SOON TO BE DEPRECATED") + + + + + + + @com.att.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Client should send valid enumerated value") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @com.att.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).") + + + + + + + @com.att.aai.annotations.Metadata(description="Prefix length for oam-address") + + + + + + + @com.att.aai.annotations.Metadata(description="Gateway address") + + + + + + + @com.att.aai.annotations.Metadata(description="Loopback0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="Temporary location for stag to get to VCE") + + + + + + + @com.att.aai.annotations.Metadata(description="as-number of the VPE") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="details regarding the vpe operation, PLEASE DISCONTINUE USE OF THIS FIELD.") + + + + + + + @com.att.aai.annotations.Metadata(description="indicates whether vpe access uses SSH") + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Virtual provider edge router. In 1504, A&AI will populate this object through an M&P and tool provided to operations.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="vnfc-name,prov-status,vnfc-type,vnfc-function-code,ipaddress-v4-oam-vip,in-maint,is-closed-loop-disabled,group-notation",searchable="vnfc-name",container="vnfcs",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of vnfc.") + + + + + + + @com.att.aai.annotations.Metadata(description="function code") + + + + + + + @com.att.aai.annotations.Metadata(description="type") + + + + + + + @com.att.aai.annotations.Metadata(description="prov status of this vnfc") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by APP-C") + + + + + + + @com.att.aai.annotations.Metadata(description="Oam V4 vip address of this vnfc") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether closed loop function is enabled on this node") + + + + + + + @com.att.aai.annotations.Metadata(description="Group notation of VNFC") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="virtual network components associated with a vserver from application controller.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="subnet-id,subnet-name",nameProps="subnet-name",uniqueProps="subnet-id",dependentOn="l3-network",container="subnets") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Subnet ID, should be UUID.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name associated with the subnet.") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron id of this subnet") + + + + + + + @com.att.aai.annotations.Metadata(description="gateway ip address") + + + + + + + @com.att.aai.annotations.Metadata(description="network start address") + + + + + + + @com.att.aai.annotations.Metadata(description="cidr mask") + + + + + + + @com.att.aai.annotations.Metadata(description="ip version") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="dhcp enabled") + + + + + + + @com.att.aai.annotations.Metadata(description="the start address reserved for use by dhcp") + + + + + + + @com.att.aai.annotations.Metadata(description="the last address reserved for use by dhcp") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(indexedProps="vlan-id-inner",dependentOn="l3-network",container="ctag-assignments") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="id.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack segmentation assignment.",indexedProps="segmentation-id",dependentOn="l3-network",container="segmentation-assignments") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Route Table Reference id, UUID assigned to this instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack segmentation assignments") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Generic network definition",nameProps="network-name",indexedProps="heat-stack-id,network-uuid,service-id,network-id,network-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-network-fqdn,network-role",searchable="network-id,network-name",uniqueProps="network-id",container="l3-networks",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Network ID, should be uuid. Unique across A&AI.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the network, governed by some naming convention..") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of the network - who defines these values?") + + + + + + + @com.att.aai.annotations.Metadata(description="Role the network plans - who defines these values?") + + + + + + + @com.att.aai.annotations.Metadata(description="Network technology - who defines these values?") + + + + + + + @com.att.aai.annotations.Metadata(description="Neutron network id of this Interface") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="Set to true if bound to VPN") + + + + + + + @com.att.aai.annotations.Metadata(description="Unique identifier of service from ASDC. Does not strictly map to ASDC services. SOON TO BE DEPRECATED") + + + + + + + @com.att.aai.annotations.Metadata(description="network role instance") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @com.att.aai.annotations.Metadata(description="Contrail FQDN for the network") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name associated with the physical network.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is a provider network.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is a shared network.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is an external network.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Relates to tenant (or is it a child of tenant), complex, service, vpn-binding") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(nameProps="network-policy-fqdn",indexedProps="network-policy-id,network-policy-fqdn",searchable="network-policy-id,network-policy-fqdn",uniqueProps="network-policy-id",container="network-policies",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="UUID representing unique key to this instance") + + + + + + + @com.att.aai.annotations.Metadata(description="Contrail FQDN for the policy") + + + + + + + @com.att.aai.annotations.Metadata(description="ID for the openStack Heat instance") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="a deployment unit of VNFCs",indexedProps="vf-module-id,vf-module-name,heat-stack-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-service-instance-fqdn",searchable="vf-module-id,vf-module-name",dependentOn="generic-vnf",container="vf-modules") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique ID of vf-module.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of vf-module") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="orchestration status of this vf-module, mastered by MSO") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is base vf module") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the Contrail unique ID for a service-instance") + + + + + + + @com.att.aai.annotations.Metadata(description="the index will track the number of modules of a given type that have been deployed in a VNF, starting with 0, and always choosing the lowest available digit") + + + + + + + @com.att.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of vf-modules, a deployment unit of VNFCs") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="General purpose VNF",nameProps="vnf-name",indexedProps="is-closed-loop-disabled,vnf-name2,vnf-type,heat-stack-id,in-maint,vnf-name,vnf-id,regional-resource-zone,prov-status,service-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,nf-type,nf-role,nf-function,nf-naming-code",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="generic-vnfs",namespace="network",extendsFrom="vnf") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @com.att.aai.annotations.Metadata(description="Unique identifier of service, does not necessarily map to ASDC service models. SOON TO BE DEPRECATED") + + + + + + + @com.att.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Client should send valid enumerated value") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, used by MSO.") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @com.att.aai.annotations.Metadata(description="identifier of managed by ATT or customer") + + + + + + + @com.att.aai.annotations.Metadata(description="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by generic-vnf.") + + + + + + + @com.att.aai.annotations.Metadata(description="v4 Loopback0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="v6 Loopback address") + + + + + + + @com.att.aai.annotations.Metadata(description="v6 management address") + + + + + + + @com.att.aai.annotations.Metadata(description="number of vcpus ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @com.att.aai.annotations.Metadata(description="units associated with vcpu, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @com.att.aai.annotations.Metadata(description="number of GB of memory ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @com.att.aai.annotations.Metadata(description="units associated with vmemory, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @com.att.aai.annotations.Metadata(description="number of vdisks ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only uCPE") + + + + + + + @com.att.aai.annotations.Metadata(description="units associated with vdisk, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether closed loop function is enabled on this node") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="details regarding the generic-vnf operation, PLEASE DISCONTINUE USE OF THIS FIELD.") + + + + + + + @com.att.aai.annotations.Metadata(description="indicates whether generic-vnf access uses SSH") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC model version uuid for this resource or service model.") + + + + + + + @com.att.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @com.att.aai.annotations.Metadata(description="as-number of the VNF") + + + + + + + @com.att.aai.annotations.Metadata(description="represents sub zone of the rr plane") + + + + + + + @com.att.aai.annotations.Metadata(description="Generic description of the type of the resource") + + + + + + + @com.att.aai.annotations.Metadata(description="Role that this asset will be playing in its context.") + + + + + + + @com.att.aai.annotations.Metadata(description="English description of function that the specific resource deployment is providing. Assigned as part of the customization of a resource in a service") + + + + + + + @com.att.aai.annotations.Metadata(description="Short code that is used in naming instances of the item being modelled") + + + + + + + @com.att.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of VNFs") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="LAG links can connect lag-interfaces",indexedProps="link-name",container="lag-links",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Alphabetical concatenation of lag-interface names") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of link aggregation connections") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,prov-status,vnf-id2",searchable="vnf-id2,vnf-name,vnf-name2",uniqueProps="vnf-id2",container="newvces",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of VNF, can't use same attribute name right now until we promote this new object") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @com.att.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @com.att.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.") + + + + + + + @com.att.aai.annotations.Metadata(description="Status that indicates whether the asset is in or out of the service path. Valid values are null, in-service-path, out-of-service-path.") + + + + + + + @com.att.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).") + + + + + + + @com.att.aai.annotations.Metadata(description="Client should send valid enumerated value, e.g., VPE.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="v4 Loopback0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO.") + + + + + + + @com.att.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @com.att.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="PNF represents a physical network function. typically equipment used in the D1 world. in 1607, this will be populated by SDN-C to represent a premises router that a uCPE connects to. But this can be used to represent any physical device that is not an AIC node or uCPE.",indexedProps="pnf-name,orchestration-status,inv-status",searchable="pnf-name",uniqueProps="pnf-name",container="pnfs",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="unique name of Physical Network Function.") + + + + + + + @com.att.aai.annotations.Metadata(description="name of Physical Network Function.") + + + + + + + @com.att.aai.annotations.Metadata(description="source of name2") + + + + + + + @com.att.aai.annotations.Metadata(description="id of pnf") + + + + + + + @com.att.aai.annotations.Metadata(description="Equipment type. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="Equipment vendor. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="Equipment model. Source of truth should define valid values.") + + + + + + + @com.att.aai.annotations.Metadata(description="identifier of managed by ATT or customer") + + + + + + + @com.att.aai.annotations.Metadata(description="ipv4-oam-address with new naming convention for IP addresses") + + + + + + + @com.att.aai.annotations.Metadata(description="sw-version is the version of SW for the hosted application on the PNF.") + + + + + + + @com.att.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @com.att.aai.annotations.Metadata(description="ID of the physical frame (relay rack) where pnf is installed.") + + + + + + + @com.att.aai.annotations.Metadata(description="Serial number of the device") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV4 Loopback 0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV6 Loopback 0 address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV4 AIM address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV6 AIM address") + + + + + + + @com.att.aai.annotations.Metadata(description="IPV6 OAM address") + + + + + + + @com.att.aai.annotations.Metadata(description="CANOPI's inventory status. Only set with values exactly as defined by CANOPI.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @com.att.aai.annotations.Metadata(description="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]") + + + + + + + @com.att.aai.annotations.Metadata(description="Nf Role is the role performed by this instance in the network.") + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of Physical Network Functions.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of physical connections, typically between p-interfaces",indexedProps="circuit-id,link-name",alternateKeys1="circuit-id",container="physical-links",namespace="network",searchable="link-name,circuit-id") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="e.g., hostnameA_p-connection_nameA_hostnameZ+p_connection-nameZ") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @com.att.aai.annotations.Metadata(description="Circuit it") + + + + + + + @com.att.aai.annotations.Metadata(description="Dual access mode (e.g., primary, secondary") + + + + + + + @com.att.aai.annotations.Metadata(description="To provide information on who manages this circuit. A&AI or 3rd party transport provider") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the service Provider on this link.") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of physical connections, typically between p-interfaces") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="vig-server contains information about a vig server used for IPSec-configuration. Populated by SDN-C from 1607",indexedProps="vig-address-type",dependentOn="ipsec-configuration",container="vig-servers") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="indicates whether the VIG is for AVPN or INTERNET") + + + + + + + @com.att.aai.annotations.Metadata(description="v4 IP of the vig server") + + + + + + + @com.att.aai.annotations.Metadata(description="v6 IP of the vig server") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="IPSec configuration node will contain various configuration data for the NMTE VNF. This node will have an edge to the generic-vnf (vnf type = TE). Starting 1607, this data will be populated by SDN-C",indexedProps="ipsec-configuration-id",uniqueProps="ipsec-configuration-id",container="ipsec-configurations",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="UUID of this configuration") + + + + + + + @com.att.aai.annotations.Metadata(description="Indicate the type of VIG server like AVPN, INTERNET, BOTH") + + + + + + + @com.att.aai.annotations.Metadata(description="Encryption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc") + + + + + + + @com.att.aai.annotations.Metadata(description="ATT can offer a shared DMZ or a DMZ specific to a customer") + + + + + + + @com.att.aai.annotations.Metadata(description="Network address of shared DMZ") + + + + + + + @com.att.aai.annotations.Metadata(description="If the DMZ is a custom DMZ, this field will indicate the customer information") + + + + + + + @com.att.aai.annotations.Metadata(description="can be 1 or 2") + + + + + + + @com.att.aai.annotations.Metadata(description="Contains values like md5, sha1, sha256, sha384") + + + + + + + @com.att.aai.annotations.Metadata(description="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc") + + + + + + + @com.att.aai.annotations.Metadata(description="Diffie-Hellman group like DH-GROUP2, DH-GROUP5, DH-GROUP14") + + + + + + + @com.att.aai.annotations.Metadata(description="Group name defined in VIG for clients using aggressive mode") + + + + + + + @com.att.aai.annotations.Metadata(description="pre-shared key for the above group name ") + + + + + + + @com.att.aai.annotations.Metadata(description="Lifetime for IKEv1 SA") + + + + + + + @com.att.aai.annotations.Metadata(description="md5, sha1, sha256, sha384") + + + + + + + @com.att.aai.annotations.Metadata(description="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc") + + + + + + + @com.att.aai.annotations.Metadata(description="Life time for IPSec SA") + + + + + + + @com.att.aai.annotations.Metadata(description="enable PFS or not") + + + + + + + @com.att.aai.annotations.Metadata(description="user ID for xAuth, sm-user,ucpeHostName,nmteHostName") + + + + + + + @com.att.aai.annotations.Metadata(description="Encrypted using the Juniper $9$ algorithm") + + + + + + + @com.att.aai.annotations.Metadata(description="The time between DPD probe") + + + + + + + @com.att.aai.annotations.Metadata(description="Maximum number of DPD before claiming the tunnel is down") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Openstack route table reference.",nameProps="route-table-reference-fqdn",uniqueProps="route-table-reference-id",indexedProps="route-table-reference-id,route-table-reference-fqdn",container="route-table-references",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Route Table Reference id, UUID assigned to this instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="FQDN entry in the route table.") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack route table references") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description",uniqueProps="id",indexedProps="id,description,type,sub-type",container="instance-groups",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Instance Group ID, UUID assigned to this instance.") + + + + + + + @com.att.aai.annotations.Metadata(description="Descriptive text to help identify the usage of this instance-group") + + + + + + + @com.att.aai.annotations.Metadata(description="Only valid value today is lower case ha for high availability") + + + + + + + @com.att.aai.annotations.Metadata(description="Valid values for ha type are [geo-activeactive, geo-activestandby, local-activeactive, local-activestandby]") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of openstack route table references") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="A zone is a grouping of assets in a location homing to the same connections into the CBB",nameProps="zone-name",indexedProps="zone-id,design-type,zone-context",uniqueProps="zone-id",container="zones",namespace="network") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Code assigned by AIC to the zone") + + + + + + + @com.att.aai.annotations.Metadata(description="English name associated with the zone") + + + + + + + @com.att.aai.annotations.Metadata(description="Design of zone [Medium/Large…]") + + + + + + + @com.att.aai.annotations.Metadata(description="Context of zone [production/test]") + + + + + + + @com.att.aai.annotations.Metadata(description="Status of a zone.") + + + + + + + @com.att.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Collection of zones") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Namespace for network inventory resources.") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Internal map to define some reserved properties of a vertex",uniqueProps="aai-unique-key",indexedProps="aai-unique-key,source-of-truth,aai-node-type,aai-uri") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Internal map to define the properties of an edge and interpret the map EdgeRules",edgeInfo="edgeLabel,direction,multiplicityRule,isParent,usesResource,hasDelTarget,SVC-INFRA,SVC-INFRA-REV") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Allows for legacy POST of old-style and new-style models") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to the main definition of a model in ASDC") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to one version of a model in ASDC") + + + + + + + @com.att.aai.annotations.Metadata(description="Type of the model, e.g., service, resource, widget, etc.") + + + + + + + @com.att.aai.annotations.Metadata(description="Name of the model, which can change from version to version.") + + + + + + + @com.att.aai.annotations.Metadata(description="Invariant unique ID which does not change from version to version") + + + + + + + @com.att.aai.annotations.Metadata(description="Version") + + + + + + + @com.att.aai.annotations.Metadata(description="Description") + + + + + + + @com.att.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="QueryParameters for performing a named-query or model query") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="InstanceFilters for performing a named-query or model query") + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="SecondaryFilts for performing a named-query or model query") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="ModelAndNamedQuerySearch holds query-parameters and instance-properties for performing a named-query or model query") + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Property holder for query properties or instance properties") + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Inventory item for response list",container="inventory-response-items") + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Container for inventory items in response list",container="response-list") + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Response container for the results of a named-query or model query") + + + + + + + + + + + + + + + + + + + @com.att.aai.annotations.Metadata(description="Abstract vnf class",indexedProps="vnf-id",uniqueProps="vnf-id",inheritors="vce,vpe,generic-vnf",isAbstract="true") + + + + + + + @com.att.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v11.xsd b/bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v11.xsd new file mode 100644 index 0000000000..47385168cc --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/resources/xsd/aai_schema_v11.xsd @@ -0,0 +1,6934 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The specific type of node in the A&AI graph") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The URL to the specific resource") + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="A keyword provided by A&AI to indicate an attribute.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Value of the attribute.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Key part of a key/value pair") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Value part of a key/value pair") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="A keyword provided by A&AI to indicate type of node.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to the object in A&AI.") + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OAM network, to be deprecated shortly. Do not use for new purposes. ",nameProps="network-name",indexedProps="cvlan-tag,network-uuid,network-name",dependentOn="cloud-region",container="oam-networks") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="UUID of the network. Unique across a cloud-region") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the network.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="cvlan-id") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for VNF firewall rule so customer cannot send customer traffic over this oam network") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for VNF firewall rule so customer cannot send customer traffic over this oam network") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of OAM networks, to be deprecated shortly. Do not use for new purposes. ") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Digital virtual switch metadata, used by SDN-C to configure VCEs. A&AI needs to receive this data from the PO deployment team and administer it using the provisioningTool.sh into A&AI. ",indexedProps="vcenter-url,switch-name",dependentOn="cloud-region",container="dvs-switches") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="DVS switch name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL used to reach the vcenter") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of digital virtual switch metadata used for vmWare VCEs and VPEs.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Availability zone, a collection of compute hosts/pservers",indexedProps="availability-zone-name",dependentOn="cloud-region",container="availability-zones") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Name of the availability zone. Unique across a cloud region") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of hypervisor. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="State that indicates whether the availability zone should be used, etc. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Serves a PATCH like function. Does not enforce concurrency control. Clear each usage with AAI team.") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="APIs that are more action related than REST (e.g., notify, update).") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="A collection of C tags (vlan tags) grouped for a specific purpose.",indexedProps="availability-zone-name",dependentOn="complex",container="ctag-pools") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="The Target provider edge router") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Name of the availability zone") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Describes what the intended purpose of this pool is.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Comma separated list of ctags") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of physical locations that can house cloud-regions.",indexedProps="identity-url,data-center-code,complex-name,physical-location-id",searchable="physical-location-id,data-center-code,complex-name,street1,street2,postal-code",uniqueProps="physical-location-id",container="complexes",namespace="cloud-infrastructure") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier for physical location, e.g., CLLI") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Data center code which can be an alternate way to identify a complex") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Gamma complex name for LCP instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL of the keystone identity service") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type, e.g., central office, data center.") + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of physical locations that can house cloud-regions.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Persistent block-level storage.",indexedProps="volume-group-name,vnf-type,heat-stack-id,volume-group-id",searchable="volume-group-id,volume-group-name",dependentOn="cloud-region",container="volume-groups") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of volume-group.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the volume group.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this volume-group") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this volume-group") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="helps relate the volume group to the vf-module whose components will require the volume group") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of persistent block-level storage.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Ephemeral Block storage volume.",indexedProps="volume-id",dependentOn="vserver",container="volumes") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of block storage volume relative to the vserver.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of ephemeral Block storage volumes.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPv4 Address Range",indexedProps="l3-interface-ipv4-address,vlan-id-inner,neutron-network-id,neutron-subnet-id",dependentOn="vlan,l-interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="IP address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prefix length, 32 for single address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Inner VLAN tag") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Outer VLAN tag") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator of fixed or floating address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron network id of the interface that address belongs to") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron id of subnet that address belongs to") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPv6 Address Range",indexedProps="l3-interface-ipv6-address,vlan-id-inner,neutron-network-id,neutron-subnet-id",dependentOn="vlan,l-interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="IP address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prefix length, 128 for single address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Inner VLAN tag") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Outer VLAN tag") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator of fixed or floating address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron network id of the interface that address belongs to") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron id of subnet that address belongs to") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Definition of vlan",indexedProps="vlan-interface,vlan-id-inner,vpn-key",dependentOn="l-interface",container="vlans") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="String that identifies the interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Inner VLAN tag") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Outer VLAN tag") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used to describe (the service associated with) the vlan") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Whether customer is going to use this VLAN for backdoor connection to another customer premise device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This indicates the customers VPN ID associated with this vlan") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Status of a vnf's vlan interface, on which the customer circuit resides, mastered by SDN-C.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prov Status of the VLAN configuration related to a logical interface. Valid values [PREPROV/NVTPROV/PROV].") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Flag indicating the interface uses the IP Unnumbered configuration.") + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="SR-IOV Virtual Function (not to be confused with virtual network function)",indexedProps="pci-id,vf-vlan-filter,vf-mac-filter,vf-vlan-strip,neutron-network-id",dependentOn="l-interface",container="sriov-vfs") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="PCI ID used to identify the sriov-vf") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This metadata provides option to specify list of VLAN filters applied on VF to pass the traffic to VM.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="When MAC filters are specified, VF-agent service configures VFs to do MAC level filtering before the traffic is passed to VM.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="When this field is set to true, VF will configured to strip the outer TAG before the traffic is passed to VM.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option ensures anti VLAN spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option ensures anti MAC spoof checks are done at the VF level to comply with security. The disable check will also be honored per the VNF needs for trusted VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option defines the set of Mirror objects which essentially mirrors the traffic from source to set of collector VNF Ports.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows all broadcast traffic to reach the VM") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows unknown multicast traffic to reach the VM") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option, if set to true, sets the VF in promiscuous mode and allows unknown unicast traffic to reach the VM") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option, if set to true, instructs to insert outer tag after traffic comes out of VM.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This option is used to set the link status. Valid values as of 1607 are on, off, and auto.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron network id of the interface") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of SR-IOV Virtual Functions.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Logical interfaces, e.g., a vnic.",indexedProps="macaddr,interface-id,interface-name,network-name",dependentOn="generic-vnf,newvce,vpe,p-interface,vserver,lag-interface",container="l-interfaces") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Name given to the interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="E.g., CUSTOMER, UPLINK, etc.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Questionably placed - v6 ip addr of this interface (is in vr-lan-interface from Mary B.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ID of interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="MAC address for the interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the network") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Whether A&AI should be managing this interface of not. Could have value like CUSTOMER") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Human friendly text regarding this interface.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not port is a mirrored.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prov Status of the logical interface. Valid values [PREPROV/NVTPROV/PROV].") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Flag indicating the interface uses the IP Unnumbered configuration.") + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of logical interfaces.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Virtual Servers, aka virtual machine or VM.",nameProps="vserver-name",indexedProps="is-closed-loop-disabled,prov-status,vserver-name,vserver-id,in-maint,vserver-name2",searchable="vserver-id,vserver-name,vserver-name2",dependentOn="tenant",container="vservers") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier for this vserver relative to its tenant") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of vserver") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Alternative name of vserver") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether closed loop function is enabled on this node") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of virtual Servers, aka virtual machines or VMs.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack tenant",nameProps="tenant-name",indexedProps="tenant-name,tenant-id,tenant-context",searchable="tenant-id,tenant-name",dependentOn="cloud-region",container="tenants") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id relative to the cloud-region.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Readable name of tenant") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This field will store the tenant context.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack tenants.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack flavor.",nameProps="flavor-name",indexedProps="flavor-name,flavor-id",dependentOn="cloud-region",container="flavors") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Flavor id, expected to be unique across cloud-region.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Flavor name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Number of CPUs") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Amount of memory") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Disk space") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Amount of ephemeral disk space") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="amount of swap space allocation") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="whether flavor is available to all users or private to the tenant it was created in.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Boolean as to whether this flavor is no longer enabled") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack flavors.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack group-assignment used to store exclusivity groups (EG).",nameProps="group-name",indexedProps="group-id,group-type,group-name",searchable="group-id,group-name",dependentOn="cloud-region",container="group-assignments") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Group id, expected to be unique across cloud-region.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Group type - the type of group this instance refers to") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Group name - name assigned to the group") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Group description - description of the group") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack group assignments") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack snapshot",nameProps="snapshot-name",uniqueProps="snapshot-id",indexedProps="application,snapshot-name,application-vendor,snapshot-id,application-version,prev-snapshot-id",dependentOn="cloud-region",container="snapshots") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Snapshot id, this is the key UUID assoc associated in glance with the snapshots.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Snapshot name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Operating system architecture") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The common name of the operating system distribution in lowercase") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The operating system version as specified by the distributor.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The application that the image instantiates.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The vendor of the application.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The version of the application.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This field contains the UUID of the previous snapshot (if any).") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack snapshots") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Key/value pairs",indexedProps="metaname",dependentOn="tenant,image,service-instance,connector,model",container="metadata") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true) + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of metadatum (key/value pairs)") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack image.",nameProps="image-name",indexedProps="application,image-name,application-vendor,image-id,application-version",dependentOn="cloud-region",container="images") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Image id, expected to be unique across cloud region") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Image name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Operating system architecture.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The common name of the operating system distribution in lowercase") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The operating system version as specified by the distributor.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The application that the image instantiates.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The vendor of the application.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The version of the application.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collectio of Openstack images.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of availability zones") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="cloud-region designates an installation of a cloud cluster or region or instantiation. In AT&Ts AIC cloud, this could be an LCP or DCP. Cloud regions are uniquely identified by a composite key, cloud-owner + cloud-region-id. The format of the cloud-owner is vendor-cloudname and we will use att-aic for AT&T's AIC.",indexedProps="cloud-owner,cloud-region-id,cloud-type,owner-defined-type",nameProps="owner-defined-type",container="cloud-regions",namespace="cloud-infrastructure") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Identifies the vendor and cloud name, e.g., att-aic. First part of composite key should be formatted as vendor-cloudname") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Identifier used by the vendor for the region. Second part of composite key") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of the cloud (e.g., openstack)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Cloud-owner defined type indicator (e.g., dcp, lcp)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Software version employed at the site. NOTE - THIS FIELD IS NOT KEPT UP TO DATE.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL of the keystone identity service") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Zone where the cloud is homed. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="complex name for cloud-region instance. NOTE - THIS FIELD IS NOT CORRECTLY POPULATED.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Whether the cloud region supports (true) or does not support (false) SR-IOV automation.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(maximumDepth="0") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Network profile populated by SDN-GP for SNMP",indexedProps="nm-profile-name",container="network-profiles",namespace="cloud-infrastructure") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique name of network profile.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Encrypted SNMP community string") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of network profiles") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="SR-IOV Physical Function",indexedProps="pf-pci-id",dependentOn="p-interface",container="sriov-pfs") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Identifier for the sriov-pf") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of SR-IOV Physical Functions.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Physical interface (e.g., nic)",indexedProps="interface-name,prov-status",nameProps="prov-status",dependentOn="vpls-pe,pserver,pnf",container="p-interfaces") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Name that identifies the physical interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Nature of the services and connectivity on this port.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="CLEI or other specification for p-interface hardware.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Role specification for p-interface hardware.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicates the physical properties of the interface.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="inventory status") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of physical interfaces.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Link aggregate interface",indexedProps="interface-name,interface-id,interface-role",dependentOn="generic-vnf,pserver,vpe,vpls-pe,pnf",container="lag-interfaces") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Name that identifies the link aggregate interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Human friendly text regarding this interface.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ID of interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Role assigned to this Interface, should use values as defined in ECOMP Yang models.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of link aggregate interfaces.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Compute host whose hostname must be unique and must exactly match what is sent as a relationship to a vserver.",nameProps="pserver-name2",indexedProps="hostname,in-maint,pserver-id,pserver-name2,inv-status",searchable="hostname,pserver-name2,pserver-id,ipv4-oam-address",container="pservers",namespace="cloud-infrastructure") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Value from executing hostname on the compute node.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="PTNII name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Number of cpus") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Disk size, in GBs") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="RAM size, in MBs") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Equipment type. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Equipment vendor. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Equipment model. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Fully-qualified domain name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used to configure device, also used for troubleshooting and is IP used for traps generated by device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Serial number, may be queried") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV4 Loopback 0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV6 Loopback 0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV4 AIM address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV6 AIM address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV6 OAM address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="CANOPI's inventory status. Only set with values exactly as defined by CANOPI.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ID of Pserver") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="internet topology of Pserver") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="alternative pserver name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="purpose of pserver") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicates who owns and or manages the device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The host profile that defines the configuration of the pserver.") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of compute hosts.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Virtual organization of cloud infrastructure elements in a data center context",nameProps="vdc-name",indexedProps="vdc-name,vdc-id",container="virtual-data-centers",namespace="cloud-infrastructure") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of the vdc") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the virtual data center") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Virtual organization of cloud infrastructure elements in a data center context") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Namespace for cloud infrastructure.") + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OBSOLETE OBJECT: do not use",nameProps="name",indexedProps="assignment-group-uuid,att-uuid,name",uniqueProps="att-uuid",container="license-key-resources",namespace="license-management") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true) + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of resource instances used to connect a variety of disparate inventory widgets",indexedProps="resource-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version",container="connectors",namespace="business") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of resource instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of resource instances used to connect a variety of disparate inventory widgets") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Represents the specifics of a tunnel cross connect piece of a resource that gets separately allotted",uniqueProps="id",indexedProps="id",dependentOn="allotted-resource",container="tunnel-xconnects") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Allotted Resource id UUID assigned to this instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The WAN uplink bandwidth for WAN1") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The WAN downlink bandwidth for WAN1") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The WAN uplink bandwidth for WAN2") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The WAN downlink bandwidth for WAN2") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This object is used to store the specific tunnel cross connect aspects of an allotted resource") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Represents a slice or partial piece of a resource that gets separately allotted",nameProps="description",uniqueProps="id",indexedProps="id,model-invariant-id,model-version-id,type,role",dependentOn="service-instance",container="allotted-resources") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Allotted Resource id UUID assigned to this instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The descriptive information assigned to this allotted resource instance") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Link back to more information in the controller") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator for whether the resource is considered operational") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Generic description of the type of allotted resource.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="role in the network that this resource will be providing.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This object is used to store slices of services being offered") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Instance of a service",indexedProps="service-instance-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,service-instance-name,service-instance-location-id,orchestration-status,environment-context,workload-context",nameProps="service-instance-name",searchable="service-instance-id,service-instance-name",uniqueProps="service-instance-id",dependentOn="service-subscription",container="service-instances") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing type of service.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing the service role.") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Uniquely identifies this instance of a service") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This field will store a name assigned to the service-instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This field will store the environment context assigned to the service-instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This field will store the workload context assigned to the service-instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicates the total bandwidth to be used for this service.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="indicates the upstream bandwidth this service will use on the WAN1 port of the physical device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="indicates the downstream bandwidth this service will use on the WAN1 port of the physical device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="indicates the upstream bandwidth this service will use on the WAN2 port of the physical device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="indicates the downstream bandwidth this service will use on the WAN2 port of the physical device.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL customers will use to access the vHN Portal.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="An identifier that customers assign to the location where this service is being used.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this service.") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of service instances") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Object that group service instances.",indexedProps="service-type",dependentOn="customer",container="service-subscriptions",crossEntityReference="service-instance,service-type") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Value defined by orchestration to identify this service across ECOMP.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This property will be deleted from A&AI in the near future. Only stop gap solution.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of objects that group service instances.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="customer identifiers to provide linkage back to BSS information.",nameProps="subscriber-name",indexedProps="subscriber-name,global-customer-id,subscriber-type",searchable="global-customer-id,subscriber-name",uniqueProps="global-customer-id",container="customers",namespace="business") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Global customer id used across ECOMP to uniquely identify customer.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Subscriber name, an alternate way to retrieve a customer.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Subscriber type, a way to provide VID with only the INFRA customers.",defaultValue="CUST") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of customer identifiers to provide linkage back to BSS information.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Namespace for business related constructs") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Image object that pertain to a VNF that doesn't have associated vservers. This is a kludge.",indexedProps="application,att-uuid,application-vendor,application-version",uniqueProps="att-uuid",container="vnf-images",namespace="service-design-and-creation") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of this asset") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The application that the image instantiates.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The vendor of the application.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The version of the application.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of image objects that pertain to a VNF that doesn't have associated vservers. This is a kludge.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Stand-in for service model definitions. Likely to be deprecated in favor of models from ASDC. Does not strictly map to ASDC services.",indexedProps="service-description,service-id",container="services",namespace="service-design-and-creation") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="This gets defined by others to provide a unique ID for the service, we accept what is sent.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Description of the service") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="URL to endpoint where AAI can get more details") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="service version") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of service model definitions. Likely to be deprecated in favor of models from ASDC.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Early definition of server/resource pairings, likely to be replaced by models. No new use should be made of this.",indexedProps="service-type,vnf-type",container="service-capabilities",namespace="service-design-and-creation") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="This gets defined by others to provide a unique ID for the service, we accept what is sent.") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of service capabilities.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="element-choice-set-uuid",indexedProps="element-choice-set-uuid",allowDirectRead="true",allowDirectWrite="false",container="element-choice-sets") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="constrained-element-set-uuid",indexedProps="constrained-element-set-uuid",allowDirectRead="true",allowDirectWrite="false",container="constrained-element-sets") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This is how we would capture constraints defining allowed sets of elements.",uniqueProps="model-constraint-uuid",indexedProps="model-constraint-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-constraints") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model.",uniqueProps="model-element-uuid",indexedProps="model-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="model-elements") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicates whether this element was created as part of instantiation from this model") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="How many of this type of element are required/allowed") + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Defines how other models combine to make up a higher-level model") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Describes new constraints on this model element that are not part of that model's definition") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Subgraph definition provided by ASDC to describe a specific version of an inventory asset and its connections related to ASDC models",nameProps="model-name",indexedProps="model-version-id,model-name,model-version",uniqueProps="model-version-id",container="model-vers") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to one version of a model in ASDC") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the model, which can change from version to version.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Description") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Subgraph definition provided by ASDC to describe an inventory asset and its connections related to ASDC models, independent of version",nameProps="model-type",indexedProps="model-invariant-id,model-type",uniqueProps="model-invariant-id",container="models",namespace="service-design-and-creation") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to the main definition of a model in ASDC") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of the model, e.g., service, resource, widget, etc.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of subgraph definitions provided by ASDC to describe the inventory assets and their connections related to ASDC models") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="TBD",uniqueProps="related-lookup-uuid",indexedProps="related-lookup-uuid",allowDirectRead="true",allowDirectWrite="false",container="related-lookups") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="TBD",uniqueProps="property-constraint-uuid",indexedProps="property-constraint-uuid",allowDirectRead="true",allowDirectWrite="false",container="property-constraints") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="TBD",uniqueProps="named-query-element-uuid",indexedProps="named-query-element-uuid",allowDirectRead="true",allowDirectWrite="false",container="named-query-elements") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,autoGenerateUuid="true") + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="TBD",nameProps="named-query-name",uniqueProps="named-query-uuid",indexedProps="named-query-uuid,named-query-name",container="named-queries",namespace="service-design-and-creation") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true) + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="TBD",nameProps="named-query-name",uniqueProps="named-query-uuid",indexedProps="named-query-uuid,named-query-name",container="named-queries",namespace="service-design-and-creation") + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Namespace for objects managed by ASDC") + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Logical links generally connect l-interfaces but are used to express logical connectivity between two points",indexedProps="link-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,link-id,prov-status,circuit-id,purpose",uniqueProps="link-id",container="logical-links",namespace="network",searchable="link-name") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="e.g., evc-name, or vnf-nameA_interface-nameA_vnf-nameZ_interface-nameZ") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of logical link, e.g., evc") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v4, v6, or ds for dual stack (should be att-ip-version)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="For example, static or BGP") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indication of operational status of the logical link.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indication of the network use of the logical link.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Alias or alternate name (CLCI or D1 name).") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="UUID of the logical-link, SDNC generates this.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Circuit id") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Reason for this entity, role it is playing") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of logical connections") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="cos",dependentOn="site-pair",container="classes-of-service") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="unique identifier of probe") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="identifier of probe") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="type of probe") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="class-of-service of probe") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="site-pair-id",uniqueProps="site-pair-id",dependentOn="routing-instance",container="site-pairs") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="unique identifier of probe") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prefix address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prefix address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ip version, v4, v6") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Hostname of the destination equipment to which SLAs are measured against.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The type of destinatination equipment. Could be Router, UCPE, etc.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="probe within a set") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="routing-instance-id",uniqueProps="routing-instance-id",dependentOn="site-pair-set",container="routing-instances") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of routing instance") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="rpm owner") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="set of probes related to generic-vnf routing instance") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Set of instances for probes used to measure service level agreements",indexedProps="site-pair-set-id",uniqueProps="site-pair-set-id",container="site-pair-sets",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of site pair set.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of sets of instances for probes related to generic-vnf") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Route target information",container="route-targets",dependentOn="vpn-binding",canBeLinked="true") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Number used to identify an RT, globally unique in the network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Role assigned to this route target") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of route target information") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="VPN binding",nameProps="vpn-name,vpn-type",indexedProps="vpn-name,vpn-id,vpn-type",searchable="vpn-id,vpn-name",uniqueProps="vpn-id",container="vpn-bindings",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="VPN ID, globally unique within A&AI") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="VPN Name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the platform associated with the VPN example AVPN, Mobility") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of the vpn, should be taken from enumerated/valid values") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="region of customer vpn") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="id for this customer vpn") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used to distinguish the distinct VPN routes of separate customers who connect to the provider in an MPLS network.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="l3-networks relate to vpn-bindings") + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="VPLS Provider Edge routers.",indexedProps="prov-status,equipment-name",container="vpls-pes",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true) + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value, e.g., VPLS-PE.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Temporary location for stag to get to VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of VPLS Provider Edge routers") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="multicast-configuration-id",uniqueProps="multicast-configuration-id",container="multicast-configurations",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of multicast configuration.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="protocol of multicast configuration") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="rp type of multicast configuration") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="multicast configuration of generic-vnf ip-address") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(dependentOn="port-group",indexedProps="cvlan-tag",container="cvlan-tags") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="See mis-na-virtualization-platform.yang") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used to capture the network interfaces of this VCE",nameProps="port-group-name",indexedProps="port-group-id,heat-stack-id,interface-id,interface-name,switch-name",dependentOn="vce",container="port-groups") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of the interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron network id of this Interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron network name of this Interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Role assigned to this Interface, should use values as defined in ECOMP Yang models.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Unique ID for port group in vmware") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Likely to duplicate value of neutron network name") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="DVS or standard switch name (should be non-null for port groups associated with DVS)") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Metadata for license group.",indexedProps="group-uuid,resource-uuid",dependentOn="generic-vnf,vce,vpe",container="licenses") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID for the license group the resource belongs to, should be uuid.") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of a license resource. ") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Licenses to be allocated across resources, keyed by group-uuid and resource-uuid, related to license management") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Metadata for entitlement group.",indexedProps="group-uuid,resource-uuid",dependentOn="generic-vnf,vce,vpe",container="entitlements") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID for the entitlement group the resource comes from, should be uuid.") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of an entitlement resource. ") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Entitlements, keyed by group-uuid and resource-uuid, related to license management") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Virtual Customer Edge Router, used specifically for Gamma. This object is deprecated.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,interface-name,regional-resource-zone,vpe-id,prov-status,service-id",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="vces",namespace="network",extendsFrom="vnf") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Unique identifier of service, does not strictly map to ASDC services, SOON TO BE DEPRECATED.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator for whether the resource is considered operational") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OBSOLETE - do not use") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Network role being played by this VNF") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Unique ID of VPE connected to this VCE.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Valid v6 IP address for the WAN Link on this router. Implied length of /64.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vce, also used for troubleshooting and is IP used for traps generated by VCE.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Loopback0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OBSOLETE - see child relationships") + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of Virtual Customer Edge Routers, used specifically for Gamma. This object is deprecated.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Relationship-list must include related to info for complex.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,vnf-id,regional-resource-zone,prov-status,service-id",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="vpes",namespace="network",extendsFrom="vnf") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Unique identifier of service. Does not map strictly to ASDC services. SOON TO BE DEPRECATED") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator for whether the resource is considered operational") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OBSOLETE - do not use. See child relationships.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prefix length for oam-address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Gateway address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Loopback0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Temporary location for stag to get to VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="as-number of the VPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="details regarding the vpe operation, PLEASE DISCONTINUE USE OF THIS FIELD.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="indicates whether vpe access uses SSH") + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Virtual provider edge router. In 1504, A&AI will populate this object through an M&P and tool provided to operations.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="vnfc-name,prov-status,nfc-function,nfc-naming-code,ipaddress-v4-oam-vip,in-maint,is-closed-loop-disabled,group-notation,model-invariant-id,model-version-id",searchable="vnfc-name",container="vnfcs",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of vnfc.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Short code that is used in naming instances of the item being modeled") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="English description of function that the specific resource deployment is providing. Assigned as part of the customization of a resource in a service") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="prov status of this vnfc") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by APP-C") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Oam V4 vip address of this vnfc") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true)") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether closed loop function is enabled on this node") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Group notation of VNFC") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="virtual network components associated with a vserver from application controller.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="subnet-id,subnet-name",nameProps="subnet-name",uniqueProps="subnet-id",dependentOn="l3-network",container="subnets") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Subnet ID, should be UUID.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name associated with the subnet.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron id of this subnet") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="gateway ip address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="network start address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="cidr mask") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ip version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="dhcp enabled") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the start address reserved for use by dhcp") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the last address reserved for use by dhcp") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="role of the subnet, referenced when assigning IPs") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(indexedProps="vlan-id-inner",dependentOn="l3-network",container="ctag-assignments") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="id.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack segmentation assignment.",indexedProps="segmentation-id",dependentOn="l3-network",container="segmentation-assignments") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Route Table Reference id, UUID assigned to this instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack segmentation assignments") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Generic network definition",nameProps="network-name",indexedProps="heat-stack-id,network-uuid,service-id,network-id,network-name,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-network-fqdn,network-role",searchable="network-id,network-name",uniqueProps="network-id",container="l3-networks",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Network ID, should be uuid. Unique across A&AI.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the network, governed by some naming convention..") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of the network - who defines these values?") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Role the network plans - who defines these values?") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Network technology - who defines these values?") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Neutron network id of this Interface") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Set to true if bound to VPN") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Unique identifier of service from ASDC. Does not strictly map to ASDC services. SOON TO BE DEPRECATED") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="network role instance") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Contrail FQDN for the network") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name associated with the physical network.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is a provider network.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is a shared network.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="boolean indicatating whether or not network is an external network.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator for whether the resource is considered operational.") + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Relates to tenant (or is it a child of tenant), complex, service, vpn-binding") + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(nameProps="network-policy-fqdn",indexedProps="network-policy-id,network-policy-fqdn",searchable="network-policy-id,network-policy-fqdn",uniqueProps="network-policy-id",container="network-policies",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="UUID representing unique key to this instance") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Contrail FQDN for the policy") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ID for the openStack Heat instance") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="a deployment unit of VNFCs",indexedProps="vf-module-id,vf-module-name,heat-stack-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,contrail-service-instance-fqdn",searchable="vf-module-id,vf-module-name",dependentOn="generic-vnf",container="vf-modules") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique ID of vf-module.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of vf-module") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="orchestration status of this vf-module, mastered by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is base vf module") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the Contrail unique ID for a service-instance") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the index will track the number of modules of a given type that have been deployed in a VNF, starting with 0, and always choosing the lowest available digit") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of vf-modules, a deployment unit of VNFCs") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="General purpose VNF",nameProps="vnf-name",indexedProps="is-closed-loop-disabled,vnf-name2,vnf-type,heat-stack-id,in-maint,vnf-name,vnf-id,regional-resource-zone,prov-status,service-id,model-invariant-id,model-version-id,widget-model-id,widget-model-version,nf-type,nf-function,nf-naming-code,nf-role",searchable="vnf-id,vnf-name,vnf-name2",uniqueProps="vnf-id",container="generic-vnfs",namespace="network",extendsFrom="vnf",containsSuggestibleProps="true",suggestionAliases="VNFs") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Unique identifier of service, does not necessarily map to ASDC service models. SOON TO BE DEPRECATED") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Regional way of organizing pservers, source of truth should define values") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this resource by Service Assurance systems.",suggestibleOnSearch="true") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator for whether the resource is considered operational. Valid values are in-service-path and out-of-service-path.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OBSOLETE - do not use") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, used by MSO.",suggestibleOnSearch="true") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="identifier of managed by ATT or customer") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure generic-vnf, also used for troubleshooting and is IP used for traps generated by generic-vnf.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v4 Loopback0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v6 Loopback address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v6 management address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="number of vcpus ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="units associated with vcpu, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="number of GB of memory ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="units associated with vmemory, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="number of vdisks ordered for this instance of VNF, used for VNFs with no vservers/flavors, to be used only uCPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="units associated with vdisk, used for VNFs with no vservers/flavors, to be used only by uCPE") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="used to indicate whether closed loop function is enabled on this node") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="details regarding the generic-vnf operation, PLEASE DISCONTINUE USE OF THIS FIELD.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="indicates whether generic-vnf access uses SSH") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="UUID of the Entitlement group used for licensing VNFs, OBSOLETE - See child relationships.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="UUID of the specific entitlement resource. OBSOLETE - See child relationships.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="UUID of the license assignment group. OBSOLETE - See child relationships.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="UUID of the actual license resource. OBSOLETE - See child relationships.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model id for this resource or service model.",visibility="deployment",requires="model-version-id",dbAlias="model-invariant-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="deployment",requires="model-invariant-id",dbAlias="model-version-id-local") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC model version for this resource or service model.",visibility="internal",dataCopy="service-design-and-creation/models/model/{model-invariant-id}/model-vers/model-ver/{model-version-id}#model-version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="captures the id of all the configuration used to customize the resource for the service.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary widget model. This maps directly to the A&AI widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="the ASDC data dictionary version of the widget model.This maps directly to the A&AI version of the widget.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="as-number of the VNF") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="represents sub zone of the rr plane") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Generic description of the type of NF",suggestibleOnSearch="true") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="English description of Network function that the specific VNF deployment is providing") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="role in the network that this model will be providing") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="string assigned to this model used for naming purposes") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Path to the controller object.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Gateway address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prefix length for oam-address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Temporary location for S-TAG to get to VCE") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Network Management profile of this VNF") + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of VNFs") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="LAG links can connect lag-interfaces",indexedProps="link-name",container="lag-links",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Alphabetical concatenation of lag-interface names") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of link aggregation connections") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce.",nameProps="vnf-name",indexedProps="vnf-name,vnf-name2,vnf-type,heat-stack-id,prov-status,vnf-id2",searchable="vnf-id2,vnf-name,vnf-name2",uniqueProps="vnf-id2",container="newvces",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF, can't use same attribute name right now until we promote this new object") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Alternate name of VNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="String capturing type of vnf, that was intended to identify the ASDC resource. This field has been overloaded in service-specific ways and clients should expect changes to occur in the future to this field as ECOMP matures.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Trigger for operational monitoring of this VNF by BAU Service Assurance systems.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicator for whether the resource is considered operational") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="OBSOLETE - do not use") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Address tail-f uses to configure vpe, also used for troubleshooting and is IP used for traps generated by VPE (v4-loopback0-ip-address).") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Client should send valid enumerated value, e.g., VPE.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v4 Loopback0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Orchestration status of this VNF, mastered by MSO.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Heat stack id corresponding to this instance, managed by MSO") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Corresponds to the SDN-C catalog id used to configure this VCE") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="This object fills in the gaps from vce that were incorporated into generic-vnf. This object will be retired with vce.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="PNF represents a physical network function. typically equipment used in the D1 world. in 1607, this will be populated by SDN-C to represent a premises router that a uCPE connects to. But this can be used to represent any physical device that is not an AIC node or uCPE.",indexedProps="pnf-name,orchestration-status,inv-status",searchable="pnf-name",uniqueProps="pnf-name",container="pnfs",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="unique name of Physical Network Function.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="name of Physical Network Function.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="source of name2") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="id of pnf") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Equipment type. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Equipment vendor. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Equipment model. Source of truth should define valid values.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="identifier of managed by ATT or customer") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ipv4-oam-address with new naming convention for IP addresses") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="sw-version is the version of SW for the hosted application on the PNF.") + + + + + + + @org.openecomp.aai.annotations.Metadata(defaultValue="false",description="Used to indicate whether or not this object is in maintenance mode (maintenance mode = true). This field (in conjunction with prov-status) is used to suppress alarms and vSCL on VNFs/VMs.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ID of the physical frame (relay rack) where pnf is installed.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Serial number of the device") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV4 Loopback 0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV6 Loopback 0 address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV4 AIM address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV6 AIM address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPV6 OAM address") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="CANOPI's inventory status. Only set with values exactly as defined by CANOPI.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Prov Status of this device (not under canopi control) Valid values [PREPROV/NVTPROV/PROV]") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Nf Role is the role performed by this instance in the network.") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of Physical Network Functions.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of physical connections, typically between p-interfaces",indexedProps="circuit-id,link-name",alternateKeys1="circuit-id",container="physical-links",namespace="network",searchable="link-name,circuit-id") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="e.g., hostnameA_p-connection_nameA_hostnameZ+p_connection-nameZ") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the numeric part of the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Captures the units corresponding to the speed") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Circuit it") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Dual access mode (e.g., primary, secondary") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="To provide information on who manages this circuit. A&AI or 3rd party transport provider") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the service Provider on this link.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of physical connections, typically between p-interfaces") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="vig-server contains information about a vig server used for IPSec-configuration. Populated by SDN-C from 1607",indexedProps="vig-address-type",dependentOn="ipsec-configuration",container="vig-servers") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="indicates whether the VIG is for AVPN or INTERNET") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v4 IP of the vig server") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="v6 IP of the vig server") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="IPSec configuration node will contain various configuration data for the NMTE VNF. This node will have an edge to the generic-vnf (vnf type = TE). Starting 1607, this data will be populated by SDN-C",indexedProps="ipsec-configuration-id",uniqueProps="ipsec-configuration-id",container="ipsec-configurations",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="UUID of this configuration") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Indicate the type of VIG server like AVPN, INTERNET, BOTH") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Encryption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ATT can offer a shared DMZ or a DMZ specific to a customer") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Network address of shared DMZ") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="If the DMZ is a custom DMZ, this field will indicate the customer information") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="can be 1 or 2") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Contains values like md5, sha1, sha256, sha384") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Encyption values like 3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Diffie-Hellman group like DH-GROUP2, DH-GROUP5, DH-GROUP14") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Group name defined in VIG for clients using aggressive mode") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="pre-shared key for the above group name ") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Lifetime for IKEv1 SA") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="md5, sha1, sha256, sha384") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="3des-cbc, des-cbc, aes-128-cbc, aes-192-cbc, aes-265-cbc") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Life time for IPSec SA") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="enable PFS or not") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="user ID for xAuth, sm-user,ucpeHostName,nmteHostName") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Encrypted using the Juniper $9$ algorithm") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="The time between DPD probe") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Maximum number of DPD before claiming the tunnel is down") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Openstack route table reference.",nameProps="route-table-reference-fqdn",uniqueProps="route-table-reference-id",indexedProps="route-table-reference-id,route-table-reference-fqdn",container="route-table-references",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Route Table Reference id, UUID assigned to this instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="FQDN entry in the route table.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack route table references") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="General mechanism for grouping instances",nameProps="description",uniqueProps="id",searchable="id,description",indexedProps="id,description,type,sub-type",container="instance-groups",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="role of the instance group.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ASDC model id for this resource or service model.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ASDC model version uid for this resource model.") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Instance Group ID, UUID assigned to this instance.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Descriptive text to help identify the usage of this instance-group") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Only valid value today is lower case ha for high availability") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Valid values for ha type are [geo-activeactive, geo-activestandby, local-activeactive, local-activestandby]") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of openstack route table references") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="A zone is a grouping of assets in a location homing to the same connections into the CBB",nameProps="zone-name",indexedProps="zone-id,design-type,zone-context",uniqueProps="zone-id",container="zones",namespace="network") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Code assigned by AIC to the zone") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="English name associated with the zone") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Design of zone [Medium/Large…]") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Context of zone [production/test]") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Status of a zone.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Concurrency value") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Collection of zones") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Namespace for network inventory resources.") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Internal map to define some reserved properties of a vertex",uniqueProps="aai-unique-key",indexedProps="aai-unique-key,source-of-truth,aai-node-type,aai-uri") + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Internal map to define the properties of an edge and interpret the map EdgeRules",edgeInfo="edgeLabel,direction,multiplicityRule,isParent,usesResource,hasDelTarget,SVC-INFRA,SVC-INFRA-REV") + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Allows for legacy POST of old-style and new-style models") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to the main definition of a model in ASDC") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique identifier corresponding to one version of a model in ASDC") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Type of the model, e.g., service, resource, widget, etc.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Name of the model, which can change from version to version.") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Invariant unique ID which does not change from version to version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Version") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Description") + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Used for optimistic concurrency. Must be empty on create, valid on update and delete.") + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="QueryParameters for performing a named-query or model query") + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="InstanceFilters for performing a named-query or model query") + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="SecondaryFilts for performing a named-query or model query") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="ModelAndNamedQuerySearch holds query-parameters and instance-properties for performing a named-query or model query") + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Property holder for query properties or instance properties") + + + + + + + + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Extra properties for inventory item for response list") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Inventory item for response list",container="inventory-response-items") + + + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Container for inventory items in response list",container="response-list") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Response container for the results of a named-query or model query") + + + + + + + + + + + + @org.openecomp.aai.annotations.Metadata(description="Abstract vnf class",indexedProps="vnf-id",uniqueProps="vnf-id",inheritors="vce,vpe,generic-vnf",isAbstract="true") + + + + + + + @org.openecomp.aai.annotations.Metadata(isKey=true,description="Unique id of VNF. This is unique across the graph.") + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml new file mode 100644 index 0000000000..0492cebbe9 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/applicationContext.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml index 3dbfcce36f..b68ebd943c 100644 --- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml +++ b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -25,7 +25,14 @@ + + + + + + + diff --git a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml index 6c822a9be5..3a42877715 100644 --- a/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml +++ b/bpmn/MSOCommonBPMN/src/main/webapp/WEB-INF/web.xml @@ -32,6 +32,10 @@ resteasy-servlet /* + + contextConfigLocation + /WEB-INF/applicationContext.xml + mso.configuration MSO_PROP_TOPOLOGY=topology.properties @@ -44,6 +48,9 @@ resteasy.resources org.openecomp.mso.logger.MsoLoggingServlet,org.openecomp.mso.bpmn.core.HealthCheckHandler + + org.springframework.web.context.ContextLoaderListener + LogFilter org.openecomp.mso.logger.LogFilter diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy index cd70fa9949..f425dc8040 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/CompleteMsoProcessTest.groovy @@ -56,17 +56,13 @@ class CompleteMsoProcessTest { """ - - private String completeMsoProcessResponse = """ - BPEL UCPELayer3ServiceActivateV1 completed -""" - - @Test public void testPreProcessRequest() { ExecutionEntity mockExecution = mock(ExecutionEntity.class) when(mockExecution.getVariable("CompleteMsoProcessRequest")).thenReturn(completeMsoProcessRequest) + when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC"); + when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7"); CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess() completeMsoProcess.preProcessRequest(mockExecution) @@ -109,48 +105,6 @@ class CompleteMsoProcessTest { } - @Test - public void testpostProcessResponse(){ - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - when(mockExecution.getVariable("CMSO_mso-bpel-name")).thenReturn("UCPELayer3ServiceActivateV1") - - CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess() - completeMsoProcess.postProcessResponse(mockExecution) - - verify(mockExecution).setVariable("CompleteMsoProcessResponse", completeMsoProcessResponse) - verify(mockExecution).setVariable("CMSO_ResponseCode","200") - } - - private String updateDBStatusToSuccessPayload = """ - - - - - testReqId - BPEL - COMPLETED - - - - """ - - @Test - public void testupdateDBStatusToSuccessPayload(){ - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - when(mockExecution.getVariable("CMSO_request_id")).thenReturn("testReqId") - when(mockExecution.getVariable("URN_mso_adapters_db_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC"); - when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7"); - - CompleteMsoProcess completeMsoProcess = new CompleteMsoProcess() - completeMsoProcess.updateDBStatusToSuccessPayload(mockExecution) - - verify(mockExecution).setVariable("CMSO_updateDBStatusToSuccessPayload",updateDBStatusToSuccessPayload) - } - private String setUpdateDBstatustoSuccessPayload = """ diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy index fcc55d0933..32a4c54e8e 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/FalloutHandlerTest.groovy @@ -259,6 +259,7 @@ class FalloutHandlerTest { when(mockExecution.getVariable("FH_request_id")).thenReturn("testReqId") when(mockExecution.getVariable("FH_ErrorMessage")).thenReturn("ErrorMessage") when(mockExecution.getVariable("FH_ErrorCode")).thenReturn("ErrorCode") + when(mockExecution.getVariable("URN_mso_default_adapter_namespace")).thenReturn("http://org.openecomp.mso"); FalloutHandler falloutHandler = new FalloutHandler() falloutHandler.updateRequestGammaPayload(mockExecution) diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy new file mode 100644 index 0000000000..1e7342de68 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/GenericPutServiceTest.groovy @@ -0,0 +1,214 @@ +package org.openecomp.mso.bpmn.common.scripts + +import static org.mockito.Mockito.* +import static org.openecomp.mso.bpmn.mock.StubResponseAAI.MockPutServiceInstance; + +import org.camunda.bpm.engine.ProcessEngineServices +import org.camunda.bpm.engine.RepositoryService +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import org.camunda.bpm.engine.repository.ProcessDefinition +import org.junit.Before +import org.junit.Ignore +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.MockitoAnnotations +import org.mockito.internal.debugging.MockitoDebuggerImpl +import org.mockito.runners.MockitoJUnitRunner + +import com.github.tomakehurst.wiremock.client.WireMock +import com.github.tomakehurst.wiremock.junit.WireMockRule +import org.apache.commons.lang3.* + +@RunWith(MockitoJUnitRunner.class) +class GenericPutServiceTest { + + @Rule + public WireMockRule wireMockRule = new WireMockRule(8090); + + @Before + public void init() + { + MockitoAnnotations.initMocks(this) + + } + + @Test + public void preProcessRequest() { + + + println "************ preProcessRequest ************* " + + ExecutionEntity mockExecution = setupMock() + + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26") + when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") + when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET") + when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("GENPS_type")).thenReturn("service-instance") + + GenericPutService putServiceInstance= new GenericPutService() + putServiceInstance.preProcessRequest(mockExecution) + + // check the sequence of variable invocation + //MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl() + //preDebugger.printInvocations(mockExecution) + + verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled") + verify(mockExecution).setVariable("prefix", "GENPS_") + + // execution.getVariable("isDebugLogEnabled") + + verify(mockExecution).setVariable("GENPS_SuccessIndicator", false) + // verify(mockExecution).setVariable("globalSubscriberId", "1604-MVM-26") + // verify(mockExecution).setVariable("serviceInstanceId", "MIS%2F1604%2F0026%2FSW_INTERNET") + // verify(mockExecution).setVariable("serviceType", "SDN-ETHERNET-INTERNET") + // verify(mockExecution).setVariable("ServiceInstanceData", "f70e927b-6087-4974-9ef8-c5e4d5847ca4") + + + } + + + @Test + @Ignore + public void putServiceInstance() { + println "************ putServiceInstance ************* " + + WireMock.reset(); + + MockPutServiceInstance("1604-MVM-26", "SDN-ETHERNET-INTERNET", "MIS%252F1604%252F0026%252FSW_INTERNET", "GenericPutServiceInstance/GenericPutServiceInstance_PutServiceInstance_AAIResponse_Success.xml"); + ExecutionEntity mockExecution = setupMock() + + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26") + when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") + when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET") + when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090") + when(mockExecution.getVariable("URN_mso_workflow_PutServiceInstance_aai_business_customer_uri")).thenReturn("/aai/v7/business/customers/customer") + when(mockExecution.getVariable("GENPS_serviceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("GENPS_type")).thenReturn("service-instance") + when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_namespace")).thenReturn('http://org.openecomp.aai.inventory/') + when(mockExecution.getVariable("URN_mso_workflow_global_default_aai_version")).thenReturn("7") + when(mockExecution.getVariable("URN_mso_workflow_default_aai_v7_customer_uri")).thenReturn("/aai/v7/business/customers/customer") + when(mockExecution.getVariable("URN_mso_msoKey")).thenReturn("07a7159d3bf51a0e53be7a8f89699be7") + when(mockExecution.getVariable("URN_aai_auth")).thenReturn("757A94191D685FD2092AC1490730A4FC") + + GenericPutService serviceInstance= new GenericPutService() + serviceInstance.putServiceInstance(mockExecution) + + // check the sequence of variable invocation + MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl() + preDebugger.printInvocations(mockExecution) + + verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled") + verify(mockExecution).setVariable("prefix", "GENPS_") + + // execution.getVariable("isDebugLogEnabled") + // verify(mockExecution).setVariable("GENPSI_serviceInstanceData","f70e927b-6087-4974-9ef8-c5e4d5847ca4") + + String servicePayload = """f70e927b-6087-4974-9ef8-c5e4d5847ca4""" as String + verify(mockExecution).setVariable("GENPS_serviceInstancePayload",servicePayload) + + String serviceAaiPath = "http://localhost:28090/aai/v7/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET" + verify(mockExecution).setVariable("GENPS_putServiceInstanceAaiPath", serviceAaiPath) + + int responseCode = 200 + verify(mockExecution).setVariable("GENPS_putServiceInstanceResponseCode", responseCode) + + String aaiResponse = """ + + + + + + + + +""" + + verify(mockExecution).setVariable("GENPS_putServiceInstanceResponse", aaiResponse) + + verify(mockExecution).setVariable("GENPS_SuccessIndicator", true) + } + + @Test + @Ignore + public void putServiceInstance_404() { + + + println "************ putServiceInstance ************* " + + WireMock.reset(); + + ExecutionEntity mockExecution = setupMock() + + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + when(mockExecution.getVariable("GENPS_globalSubscriberId")).thenReturn("1604-MVM-26") + when(mockExecution.getVariable("GENPS_serviceInstanceId")).thenReturn("MIS%2F1604%2F0026%2FSW_INTERNET") + when(mockExecution.getVariable("GENPS_serviceType")).thenReturn("SDN-ETHERNET-INTERNET") + when(mockExecution.getVariable("GENPS_ServiceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + when(mockExecution.getVariable("URN_aai_endpoint")).thenReturn("http://localhost:8090") + when(mockExecution.getVariable("URN_mso_workflow_PutServiceInstance_aai_business_customer_uri")).thenReturn("/aai/v7/business/customers/customer") + when(mockExecution.getVariable("GENPS_ServiceInstanceData")).thenReturn("f70e927b-6087-4974-9ef8-c5e4d5847ca4") + + GenericPutService serviceInstance= new GenericPutService() + serviceInstance.putServiceInstance(mockExecution) + + // check the sequence of variable invocation + MockitoDebuggerImpl preDebugger = new MockitoDebuggerImpl() + preDebugger.printInvocations(mockExecution) + + verify(mockExecution, atLeast(1)).getVariable("isDebugLogEnabled") + verify(mockExecution).setVariable("prefix", "GENPS_") + + // execution.getVariable("isDebugLogEnabled") + + + verify(mockExecution).setVariable("GENPS_serviceInstanceData","f70e927b-6087-4974-9ef8-c5e4d5847ca4") + + String serviceInstancepayload = """f70e927b-6087-4974-9ef8-c5e4d5847ca4 + """ as String + verify(mockExecution).setVariable("GENPS_serviceInstancePayload",serviceInstancepayload) + + String serviceInstanceAaiPath = "http://localhost:8090/aai/v7/business/customers/customer/1604-MVM-26/service-subscriptions/service-subscription/SDN-ETHERNET-INTERNET/service-instances/service-instance/MIS%252F1604%252F0026%252FSW_INTERNET" + verify(mockExecution).setVariable("GENPS_putServiceInstanceAaiPath", serviceInstanceAaiPath) + + int responseCode = 404 + verify(mockExecution).setVariable("GENPS_putServiceInstanceResponseCode", responseCode) + + String aaiResponse = "" + verify(mockExecution).setVariable("GENPS_putServiceInstanceResponse", aaiResponse) + + verify(mockExecution).setVariable("GENPS_SuccessIndicator", false) + + + } + + + private ExecutionEntity setupMock() { + + ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) + when(mockProcessDefinition.getKey()).thenReturn("PutServiceInstance") + RepositoryService mockRepositoryService = mock(RepositoryService.class) + when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) + when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn("PutServiceInstance") + when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") + ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) + when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) + + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + // Initialize prerequisite variables + + when(mockExecution.getId()).thenReturn("100") + when(mockExecution.getProcessDefinitionId()).thenReturn("PutServiceInstance") + when(mockExecution.getProcessInstanceId()).thenReturn("PutServiceInstance") + when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) + when(mockExecution.getProcessEngineServices().getRepositoryService().getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(mockProcessDefinition) + + return mockExecution + } + +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy new file mode 100644 index 0000000000..bc1eb4577e --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/NetworkUtilsTest.groovy @@ -0,0 +1,97 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common.scripts + +import static org.mockito.Mockito.* +import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity +import static org.junit.Assert.*; +import org.junit.Test; + +class NetworkUtilsTest { + + def volumeRequestXml = """ + + CREATE_VF_MODULE_VOL + VID + + + + + MSOTESTVOL101a-vSAMP12_base_vol_module-0 + Test/vSAMP12 + vSAMP12::base::module-0 + 2.0 + mdt1 + 88a6ca3ee0394ade9403f075db23167e + a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + + + + STMTN5MMSC20 + US1117MTSNJVBR0246 + +""" + + @Test + public void testIsRollbackEnabled() { + + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true') + when(mockExecution.getVariable("URN_mso_rollback")).thenReturn(true) + + NetworkUtils networkUtils = new NetworkUtils() + def rollbackEnabled = networkUtils.isRollbackEnabled(mockExecution, volumeRequestXml) + + assertEquals(true, rollbackEnabled) + + } + + @Test + public void testIsRollbackEnabled2() { + + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn('true') + when(mockExecution.getVariable("URN_mso_rollback")).thenReturn(false) + + NetworkUtils networkUtils = new NetworkUtils() + def rollbackEnabled = networkUtils.isRollbackEnabled(mockExecution, volumeRequestXml) + + assertEquals(false, rollbackEnabled) + + } + + @Test + public void testGetIpvVersion() { + + NetworkUtils networkUtils = new NetworkUtils() + println "test: ipv4" + String version4 = networkUtils.getIpvVersion("ipv4") + assertEquals("4", version4) + println "test: ipv6" + String version6 = networkUtils.getIpvVersion("ipv6") + assertEquals("6", version6) + println "test: 4" + String versionDigit4 = networkUtils.getIpvVersion("4") + assertEquals("4", versionDigit4) + + } + +} diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy index 645fbe6e8f..c4f0e9e7d4 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/openecomp/mso/bpmn/common/scripts/VidUtilsTest.groovy @@ -58,11 +58,11 @@ class VidUtilsTest { "requestDetails": { "modelInfo": { "modelType": "vfModule", - "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "STMTN5MMSC21-MMSC::model-1-0", "modelVersion": "1", - "modelCustomizationId": "ee6478e5-ea33-3346-ac12-ab121484a3fe" + "modelCustomizationUuid": "ee6478e5-ea33-3346-ac12-ab121484a3fe" }, "cloudConfiguration": { "lcpCloudRegionId": "MDTWNJ21", @@ -80,7 +80,7 @@ class VidUtilsTest { "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", "modelInfo": { "modelType": "volumeGroup", - "modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", + "modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12..base..module-0", "modelVersion": "1" @@ -92,7 +92,7 @@ class VidUtilsTest { "instanceId": "123456", "modelInfo": { "modelType": "service", - "modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", + "modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "SERVICE_MODEL_NAME", "modelVersion": "1.0" @@ -105,11 +105,11 @@ class VidUtilsTest { "instanceName": "skask-test", "modelInfo": { "modelType": "vnf", - "modelInvariantId": "skask", + "modelInvariantUuid": "skask", "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1.0", - "modelCustomizationName": "vSAMP12 1" + "modelInstanceName": "vSAMP12 1" } } } @@ -193,7 +193,7 @@ class VidUtilsTest { "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1", - "modelCustomizationName": "vSAMP12" + "modelInstanceName": "vSAMP12" } } } @@ -262,7 +262,7 @@ class VidUtilsTest { "modelInfo": { "modelType": "volumeGroup", "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12::base::module-0", "modelVersion": "1" }, @@ -282,7 +282,7 @@ class VidUtilsTest { "modelInfo": { "modelType": "service", "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "Test", "modelVersion": "2.0" } @@ -293,10 +293,10 @@ class VidUtilsTest { "modelInfo": { "modelType": "vnf", "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1", - "modelCustomizationName": "vSAMP12" + "modelInstanceName": "vSAMP12" } } } @@ -311,7 +311,7 @@ class VidUtilsTest { "modelInfo": { "modelType": "volumeGroup", "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12::base::module-0", "modelVersion": "1" }, @@ -331,7 +331,7 @@ class VidUtilsTest { "modelInfo": { "modelType": "service", "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "Test", "modelVersion": "2.0" } @@ -342,10 +342,10 @@ class VidUtilsTest { "modelInfo": { "modelType": "vnf", "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1", - "modelCustomizationName": "vSAMP12" + "modelInstanceName": "vSAMP12" } } } @@ -360,7 +360,7 @@ def bpmnReqJsonVolumeSuppressRollbackFalse = """ "modelInfo": { "modelType": "volumeGroup", "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12::base::module-0", "modelVersion": "1" }, @@ -380,7 +380,7 @@ def bpmnReqJsonVolumeSuppressRollbackFalse = """ "modelInfo": { "modelType": "service", "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "Test", "modelVersion": "2.0" } @@ -391,10 +391,10 @@ def bpmnReqJsonVolumeSuppressRollbackFalse = """ "modelInfo": { "modelType": "vnf", "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1", - "modelCustomizationName": "vSAMP12" + "modelInstanceName": "vSAMP12" } } } @@ -409,7 +409,7 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "modelInfo": { "modelType": "volumeGroup", "modelId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12::base::module-0", "modelVersion": "1" }, @@ -428,7 +428,7 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "modelInfo": { "modelType": "service", "modelId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "Test", "modelVersion": "2.0" } @@ -439,10 +439,10 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "modelInfo": { "modelType": "vnf", "modelId": "ff5256d1-5a33-55df-13ab-12abad84e7ff", - "modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", + "modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1", - "modelCustomizationName": "vSAMP12" + "modelInstanceName": "vSAMP12" } } } @@ -456,8 +456,8 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "requestDetails": { "modelInfo": { "modelType": "vfModule", -"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "STMTN5MMSC21-MMSC::model-1-0", "modelVersion": "1" }, @@ -477,8 +477,8 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", "modelInfo": { "modelType": "volumeGroup", -"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12..base..module-0", "modelVersion": "1" } @@ -489,8 +489,8 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "instanceId": "123456", "modelInfo": { "modelType": "service", -"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "SERVICE_MODEL_NAME", "modelVersion": "1.0" } @@ -502,11 +502,11 @@ def bpmnReqJsonVolumeSuppressRollbackNone = """ "instanceName": "skask-test", "modelInfo": { "modelType": "vnf", -"modelInvariantId": "skask", -"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "skask", +"modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1.0", -"modelCustomizationName": "vSAMP12 1" +"modelInstanceName": "vSAMP12 1" } } } @@ -523,8 +523,8 @@ def bpmnReqJsonVfModuleSuppressRollbackFalse = """ "requestDetails": { "modelInfo": { "modelType": "vfModule", -"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "STMTN5MMSC21-MMSC::model-1-0", "modelVersion": "1" }, @@ -544,8 +544,8 @@ def bpmnReqJsonVfModuleSuppressRollbackFalse = """ "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", "modelInfo": { "modelType": "volumeGroup", -"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12..base..module-0", "modelVersion": "1" } @@ -556,8 +556,8 @@ def bpmnReqJsonVfModuleSuppressRollbackFalse = """ "instanceId": "123456", "modelInfo": { "modelType": "service", -"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "SERVICE_MODEL_NAME", "modelVersion": "1.0" } @@ -569,11 +569,11 @@ def bpmnReqJsonVfModuleSuppressRollbackFalse = """ "instanceName": "skask-test", "modelInfo": { "modelType": "vnf", -"modelInvariantId": "skask", -"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "skask", +"modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1.0", -"modelCustomizationName": "vSAMP12 1" +"modelInstanceName": "vSAMP12 1" } } } @@ -590,8 +590,8 @@ def bpmnReqJsonVfModuleSuppressRollbackNone = """ "requestDetails": { "modelInfo": { "modelType": "vfModule", -"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "STMTN5MMSC21-MMSC::model-1-0", "modelVersion": "1" }, @@ -610,8 +610,8 @@ def bpmnReqJsonVfModuleSuppressRollbackNone = """ "instanceName": "MSOTESTVOL103a-vSAMP12_base_module-0_vol", "modelInfo": { "modelType": "volumeGroup", -"modelInvariantId": "ff5256d2-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6478e5-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff5256d2-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6478e5-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12..base..module-0", "modelVersion": "1" } @@ -622,8 +622,8 @@ def bpmnReqJsonVfModuleSuppressRollbackNone = """ "instanceId": "123456", "modelInfo": { "modelType": "service", -"modelInvariantId": "ff3514e3-5a33-55df-13ab-12abad84e7ff", -"modelNameVersionId": "fe6985cd-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "ff3514e3-5a33-55df-13ab-12abad84e7ff", +"modelUuid": "fe6985cd-ea33-3346-ac12-ab121484a3fe", "modelName": "SERVICE_MODEL_NAME", "modelVersion": "1.0" } @@ -635,11 +635,11 @@ def bpmnReqJsonVfModuleSuppressRollbackNone = """ "instanceName": "skask-test", "modelInfo": { "modelType": "vnf", -"modelInvariantId": "skask", -"modelNameVersionId": "fe6478e4-ea33-3346-ac12-ab121484a3fe", +"modelInvariantUuid": "skask", +"modelUuid": "fe6478e4-ea33-3346-ac12-ab121484a3fe", "modelName": "vSAMP12", "modelVersion": "1.0", -"modelCustomizationName": "vSAMP12 1" +"modelInstanceName": "vSAMP12 1" } } } @@ -762,7 +762,7 @@ def vidUtilVfModuleRespBackoutOnFailureFalse = """ false ff5256d2-5a33-55df-13ab-12abad84e7ff - 1 + fe6478e5-ea33-3346-ac12-ab121484a3fe @@ -792,7 +792,7 @@ def vidUtilVfModuleRespBackoutOnFailureTrue = """ true ff5256d2-5a33-55df-13ab-12abad84e7ff - 1 + fe6478e5-ea33-3346-ac12-ab121484a3fe @@ -822,7 +822,7 @@ def vidUtilVfModuleRespBackoutOnFailureEmpty = """ ff5256d2-5a33-55df-13ab-12abad84e7ff - 1 + fe6478e5-ea33-3346-ac12-ab121484a3fe diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java index 27f2479a7b..c476c6577f 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/BPMNUtil.java @@ -19,7 +19,7 @@ import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.jboss.resteasy.spi.AsynchronousResponse; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource; +import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; @@ -166,7 +166,7 @@ public class BPMNUtil { * @param variables */ private static void executeAsyncFlow(ProcessEngineServices processEngineServices, String processKey, AsynchronousResponse asyncResponse, Map variables) { - WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); VariableMapImpl variableMap = new VariableMapImpl(); Map variableValueType = new HashMap(); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java new file mode 100644 index 0000000000..6ec9493557 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/DecomposeServiceTest.java @@ -0,0 +1,95 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common; + +import static org.openecomp.mso.bpmn.mock.StubResponseDatabase.MockGetServiceResourcesCatalogData; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.camunda.bpm.engine.test.Deployment; +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.mso.bpmn.common.WorkflowTest; + +/** + * Unit Test for the DecomposeService Flow + * + */ +public class DecomposeServiceTest extends WorkflowTest { + + + public DecomposeServiceTest() throws IOException { + + } + + @Test + @Deployment(resources = {"subprocess/BuildingBlock/DecomposeService.bpmn"}) + public void testDecomposeService_success() throws Exception{ + MockGetServiceResourcesCatalogData("cmw-123-456-789", "/getCatalogServiceResourcesData.json", "1.0"); + + + String businessKey = UUID.randomUUID().toString(); + Map variables = new HashMap(); + setVariablesSuccess(variables, "testRequestId123", "ff5256d2-5a33-55df-13ab-12abad84e7ff"); + invokeSubProcess("DecomposeService", businessKey, variables); + + waitForProcessEnd(businessKey, 10000); + + Assert.assertTrue(isProcessEnded(businessKey)); + + } + + //@Test + @Deployment(resources = {"subprocess/BuildingBlock/DecomposeService.bpmn"}) + public void testDecomposeService_success_partial() throws Exception{ + MockGetServiceResourcesCatalogData("cmw-123-456-789", "/getCatalogServiceResourcesDataNoNetwork.json"); + + + String businessKey = UUID.randomUUID().toString(); + Map variables = new HashMap(); + setVariablesSuccess(variables, "testRequestId123", "ff5256d2-5a33-55df-13ab-12abad84e7ff"); + invokeSubProcess("DecomposeService", businessKey, variables); + + waitForProcessEnd(businessKey, 10000); + + Assert.assertTrue(isProcessEnded(businessKey)); + + } + + private void setVariablesSuccess(Map variables, String requestId, String siId) { + variables.put("isDebugLogEnabled", "true"); + variables.put("mso-request-id", requestId); + variables.put("msoRequestId", requestId); + variables.put("serviceInstanceId",siId); + + String serviceModelInfo = "{ "+ "\"modelType\": \"service\"," + + "\"modelInvariantUuid\": \"cmw-123-456-789\"," + + "\"modelVersionId\": \"ab6478e5-ea33-3346-ac12-ab121484a3fe\"," + + "\"modelName\": \"ServicevSAMP12\"," + + "\"modelVersion\": \"1.0\"," + + "}"; + variables.put("serviceModelInfo", serviceModelInfo); + + } + +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java new file mode 100644 index 0000000000..c68c7bb184 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/ManualHandlingTest.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; + +import org.camunda.bpm.engine.TaskService; +import org.camunda.bpm.ProcessEngineService; +import org.camunda.bpm.engine.task.TaskQuery; +import org.camunda.bpm.engine.task.Task; +import org.camunda.bpm.engine.delegate.BpmnError; +import org.camunda.bpm.engine.delegate.DelegateTask; +import org.camunda.bpm.engine.runtime.Execution; + +import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; +import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; +import static com.github.tomakehurst.wiremock.client.WireMock.containing; +import static com.github.tomakehurst.wiremock.client.WireMock.put; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; +import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; +import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; +import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicyAbort; + +import java.io.DataOutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import java.util.List; + +import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.test.Deployment; +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; +import org.openecomp.mso.bpmn.core.WorkflowException; + +/** + * Unit test for RainyDayHandler.bpmn. + */ +public class ManualHandlingTest extends WorkflowTest { + + @Test + @Deployment(resources = { + "subprocess/BuildingBlock/ManualHandling.bpmn" + }) + public void TestManualHandlingSuccess() { + + RuntimeService runtimeService = processEngineRule.getRuntimeService(); + Map variables = new HashMap(); + variables.put("isDebugLogEnabled","true"); + variables.put("msoRequestId", "testRequestId"); + variables.put("serviceType", "X"); + variables.put("vnfType", "Y"); + variables.put("currentActivity", "BB1"); + variables.put("workStep", "1"); + variables.put("failedActivity", ""); + variables.put("errorCode", "123"); + variables.put("errorText", "update failed"); + variables.put("validResponses", "Rollback"); + + + String businessKey = UUID.randomUUID().toString(); + invokeSubProcess("ManualHandling", businessKey, variables); + + try { + Thread.sleep(5); + } catch (Exception e) { + + } + + TaskService taskService = processEngineRule.getTaskService(); + + TaskQuery q = taskService.createTaskQuery(); + + List tasks = q.orderByTaskCreateTime().asc().list(); + int i = 0; + + for (Task task : tasks) { + + + System.out.println("TASK ID: " + task.getId()); + System.out.println("TASK NAME: " + task.getName()); + try { + System.out.println("Completing the task"); + Map completeVariables = new HashMap(); + completeVariables.put("responseValue", "skip"); + taskService.complete(task.getId(), completeVariables); + } + catch(Exception e) { + System.out.println("GOT EXCEPTION: " + e.getMessage()); + } + } + + waitForProcessEnd(businessKey, 100000); + + Assert.assertTrue(isProcessEnded(businessKey)); + + } + + +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java new file mode 100644 index 0000000000..86b59f9074 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/RainyDayHandlerTest.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common; + +import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; +import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; +import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; +import static com.github.tomakehurst.wiremock.client.WireMock.containing; +import static com.github.tomakehurst.wiremock.client.WireMock.put; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; +import static org.openecomp.mso.bpmn.common.BPMNUtil.executeWorkFlow; +import static org.openecomp.mso.bpmn.common.BPMNUtil.waitForWorkflowToFinish; +import static org.openecomp.mso.bpmn.mock.StubResponsePolicy.MockPolicyAbort; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +import org.camunda.bpm.engine.RuntimeService; +import org.camunda.bpm.engine.test.Deployment; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; +import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; +import org.openecomp.mso.bpmn.core.WorkflowException; + +/** + * Unit test for RainyDayHandler.bpmn. + */ +public class RainyDayHandlerTest extends WorkflowTest { + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + @Deployment(resources = { + "subprocess/BuildingBlock/RainyDayHandler.bpmn", + "subprocess/BuildingBlock/ManualHandling.bpmn" + }) + public void TestRainyDayHandlingSuccess() { + + RuntimeService runtimeService = processEngineRule.getRuntimeService(); + Map variables = new HashMap(); + variables.put("isDebugLogEnabled","true"); + variables.put("msoRequestId", "testRequestId"); + variables.put("serviceType", "X"); + variables.put("vnfType", "Y"); + variables.put("currentActivity", "BB1"); + variables.put("workStep", "1"); + variables.put("failedActivity", ""); + variables.put("errorCode", "123"); + variables.put("errorText", "update failed"); + + MockPolicyAbort(); + + + String businessKey = UUID.randomUUID().toString(); + invokeSubProcess("RainyDayHandler", businessKey, variables); + + waitForProcessEnd(businessKey, 10000); + + Assert.assertTrue(isProcessEnded(businessKey)); + + } + + + +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java index 3eb7acd91a..d1ca98ccab 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/SDNCAdapterV1Test.java @@ -38,6 +38,7 @@ import org.camunda.bpm.engine.runtime.Job; import org.camunda.bpm.engine.test.Deployment; import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.openecomp.mso.bpmn.common.adapter.sdnc.CallbackHeader; import org.openecomp.mso.bpmn.common.adapter.sdnc.SDNCAdapterCallbackRequest; @@ -47,6 +48,7 @@ import org.openecomp.mso.bpmn.common.workflow.service.SDNCAdapterCallbackService import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; import org.openecomp.mso.bpmn.core.PropertyConfigurationSetup; +import org.openecomp.mso.bpmn.core.xml.XmlTool; import org.openecomp.mso.bpmn.mock.FileUtil; /** @@ -173,6 +175,7 @@ public class SDNCAdapterV1Test extends WorkflowTest { checkForTimeout(pid); assertEquals(true, (Boolean) (getVariable(pid, "continueListening"))); + assertEquals(false, (Boolean) (getVariable(pid, "SDNCA_InterimNotify"))); //System.out.println("SDNCAdapter interim status processing flow Completed!"); @@ -215,6 +218,7 @@ public class SDNCAdapterV1Test extends WorkflowTest { assertFalse(sdncAdapterResponse instanceof SDNCAdapterErrorResponse); assertProcessInstanceNotFinished(pid); assertEquals(true, (Boolean) (getVariable(pid, "continueListening"))); + assertEquals(false, (Boolean) (getVariable(pid, "SDNCA_InterimNotify"))); // Inject a "final" SDNC Adapter asynchronous callback message sdncAdapterCallbackRequest.setRequestData(sdncAdapterCallbackRequestData); @@ -224,11 +228,74 @@ public class SDNCAdapterV1Test extends WorkflowTest { assertFalse(sdncAdapterResponse instanceof SDNCAdapterErrorResponse); assertProcessInstanceFinished(pid); assertEquals(false, (Boolean) (getVariable(pid, "continueListening"))); + assertEquals(false, (Boolean) (getVariable(pid, "SDNCA_InterimNotify"))); + + //System.out.println("SDNCAdapter non-final then final processing flow Completed!"); + } + + + @Test + @Deployment(resources = {"subprocess/SDNCAdapterV1.bpmn", + "subprocess/GenericNotificationService.bpmn" + }) + public void nonFinalThenFinalWithNotify() throws InterruptedException { + + mockSDNCAdapter(200); + mockUpdateRequestDB(200, "Database/DBAdapter.xml"); + + //System.out.println("SDNCAdapter non-final then final processing flow Started!"); + + String modSdncAdapterWorkflowRequestAct = sdncAdapterWorkflowRequestAct; + try { + // only service-type "uCPE-VMS" is applicable to notification, so modify the test request + modSdncAdapterWorkflowRequestAct = XmlTool.modifyElement(sdncAdapterWorkflowRequestAct, "tag0:service-type", "uCPE-VMS").get(); + System.out.println("modified request: " + modSdncAdapterWorkflowRequestAct); + } catch (Exception e) { + System.out.println("request modification failed"); + //e.printStackTrace(); + } + + // Start the flow + ProcessExecutionThread thread = new ProcessExecutionThread(modSdncAdapterWorkflowRequestAct); + thread.start(); + waitForExecutionToStart("sdncAdapter", 3); + String pid = getPid(); + + assertProcessInstanceNotFinished(pid); + + // Inject a "non-final" SDNC Adapter asynchronous callback message + //System.out.println("Injecting SDNC Adapter asynchronous callback message to continue processing"); + String generatedRequestId = (String) processEngineRule.getRuntimeService().getVariable(pid, "SDNCA_requestId"); + CallbackHeader callbackHeader = new CallbackHeader(); + callbackHeader.setRequestId(generatedRequestId); + callbackHeader.setResponseCode("200"); + callbackHeader.setResponseMessage("OK"); + SDNCAdapterCallbackRequest sdncAdapterCallbackRequest = new SDNCAdapterCallbackRequest(); + sdncAdapterCallbackRequest.setCallbackHeader(callbackHeader); + sdncAdapterCallbackRequest.setRequestData(sdncAdapterCallbackRequestDataNonfinal); + SDNCAdapterCallbackServiceImpl callbackService = new SDNCAdapterCallbackServiceImpl(); + callbackService.setProcessEngineServices4junit(processEngineRule); + SDNCAdapterResponse sdncAdapterResponse = callbackService.sdncAdapterCallback(sdncAdapterCallbackRequest); + //System.out.println("Back from executing process again"); + + assertFalse(sdncAdapterResponse instanceof SDNCAdapterErrorResponse); + assertProcessInstanceNotFinished(pid); + assertEquals(true, (Boolean) (getVariable(pid, "continueListening"))); + assertEquals(true, (Boolean) (getVariable(pid, "SDNCA_InterimNotify"))); + + // Inject a "final" SDNC Adapter asynchronous callback message + sdncAdapterCallbackRequest.setRequestData(sdncAdapterCallbackRequestData); + sdncAdapterResponse = callbackService.sdncAdapterCallback(sdncAdapterCallbackRequest); + //System.out.println("Back from executing process again"); + + assertFalse(sdncAdapterResponse instanceof SDNCAdapterErrorResponse); + assertProcessInstanceFinished(pid); + assertEquals(false, (Boolean) (getVariable(pid, "continueListening"))); + assertEquals(false, (Boolean) (getVariable(pid, "SDNCA_InterimNotify"))); //System.out.println("SDNCAdapter non-final then final processing flow Completed!"); } - private void waitForExecutionToStart(String processDefintion, int count) throws InterruptedException { //System.out.println(processEngineRule.getRuntimeService().createExecutionQuery().processDefinitionKey(processDefintion).count()); @@ -238,6 +305,7 @@ public class SDNCAdapterV1Test extends WorkflowTest { } @Test + @Ignore // Ignored because PropertyConfigurationSetup is timing out @Deployment(resources = {"subprocess/SDNCAdapterV1.bpmn", "subprocess/GenericNotificationService.bpmn" }) diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java index 4ac885fd9d..abad6c373d 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowAsyncResourceTest.java @@ -31,7 +31,7 @@ import org.camunda.bpm.engine.test.Deployment; import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.jboss.resteasy.spi.AsynchronousResponse; import org.junit.Test; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource; +import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; public class WorkflowAsyncResourceTest extends WorkflowTest { @@ -53,7 +53,7 @@ public class WorkflowAsyncResourceTest extends WorkflowTest { } private void executeWorkflow(String request, String requestId, AsynchronousResponse asyncResponse, String processKey) { - WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); VariableMapImpl variableMap = new VariableMapImpl(); Map variableValueType = new HashMap(); diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java index 49ad6d6e34..4deac221a5 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/bpmn/common/WorkflowTest.java @@ -1,22 +1,22 @@ -/*- - * ============LICENSE_START======================================================= - * OPENECOMP - MSO - * ================================================================================ - * 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========================================================= - */ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * 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.openecomp.mso.bpmn.common; @@ -60,6 +60,8 @@ import org.camunda.bpm.engine.variable.impl.VariableMapImpl; import org.custommonkey.xmlunit.DetailedDiff; import org.custommonkey.xmlunit.XMLUnit; import org.jboss.resteasy.spi.AsynchronousResponse; +import org.json.JSONArray; +import org.json.JSONObject; import org.junit.Before; import org.junit.Rule; import org.openecomp.mso.bpmn.common.adapter.sdnc.CallbackHeader; @@ -73,11 +75,15 @@ import org.openecomp.mso.bpmn.common.adapter.vnf.UpdateVnfNotification; import org.openecomp.mso.bpmn.common.adapter.vnf.VnfRollback; import org.openecomp.mso.bpmn.common.workflow.service.SDNCAdapterCallbackServiceImpl; import org.openecomp.mso.bpmn.common.workflow.service.VnfAdapterNotifyServiceImpl; -import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncCommonResource; +import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource; import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResponse; import org.openecomp.mso.bpmn.core.CamundaDBSetup; import org.openecomp.mso.bpmn.core.PropertyConfigurationSetup; +import org.openecomp.mso.bpmn.core.domain.Resource; +import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition; + +import static org.openecomp.mso.bpmn.core.json.JsonUtils.*; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -119,6 +125,7 @@ public class WorkflowTest { */ protected static final String JSON = "application/json; charset=UTF-8"; + /** * Constructor. */ @@ -265,7 +272,7 @@ public class WorkflowTest { VariableMapImpl variableMapImpl = createVariableMapImpl(variables); System.out.println("Sending " + request + " to " + processKey + " process"); - WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); workflowResource.setProcessEngineServices4junit(processEngineRule); TestAsyncResponse asyncResponse = new TestAsyncResponse(); @@ -298,7 +305,7 @@ public class WorkflowTest { VariableMapImpl variableMapImpl = createVariableMapImpl(variables); System.out.println("Sending " + request + " to " + processKey + " process"); - WorkflowAsyncCommonResource workflowResource = new WorkflowAsyncCommonResource(); + WorkflowAsyncResource workflowResource = new WorkflowAsyncResource(); workflowResource.setProcessEngineServices4junit(processEngineRule); TestAsyncResponse asyncResponse = new TestAsyncResponse(); @@ -619,6 +626,18 @@ public class WorkflowTest { content = callbackData.getContent(); respCode = 200; respMsg = "OK"; + } else if ("CREATED".equals(modifier)) { + CallbackData callbackData = callbacks.get(action); + + if (callbackData == null) { + String msg = "No callback defined for '" + action + "' SDNC request"; + System.out.println(msg); + fail(msg); + } + + content = callbackData.getContent(); + respCode = 201; + respMsg = "Created"; } else if ("ERR".equals(modifier)) { content = "((REQUEST-ID))500SIMULATED ERROR FROM SDNC ADAPTER"; respCode = 500; @@ -1385,6 +1404,127 @@ public class WorkflowTest { return true; } + /** + * Runs a program to inject sniro workflow messages into the test environment. + * A program is essentially just a list of keys that identify event data + * to be injected, in sequence. For more details, see + * injectSNIROCallbacks(String contentType, String messageType, String content, long timeout) + * + * Errors are handled with junit assertions and will cause the test to fail. + * NOTE: Each callback must have a workflow message type associated with it. + * + * @param callbacks an object containing event data for the program + * @param program the program to execute + */ + protected void injectSNIROCallbacks(CallbackSet callbacks, String program) { + + String[] cmds = program.replaceAll("\\s+", "").split(","); + + for (String cmd : cmds) { + String action = cmd; + String modifier = "STD"; + + if (cmd.contains(":")) { + String[] parts = cmd.split(":"); + action = parts[0]; + modifier = parts[1]; + } + + String messageType = null; + String content = null; + String contentType = null; + + if ("STD".equals(modifier)) { + CallbackData callbackData = callbacks.get(action); + + if (callbackData == null) { + String msg = "No '" + action + "' workflow message callback is defined"; + System.out.println(msg); + fail(msg); + } + + messageType = callbackData.getMessageType(); + + if (messageType == null || messageType.trim().equals("")) { + String msg = "No workflow message type is defined in the '" + action + "' callback"; + System.out.println(msg); + fail(msg); + } + + content = callbackData.getContent(); + contentType = callbackData.getContentType(); + } else { + String msg = "Invalid workflow message program modifier: '" + modifier + "'"; + System.out.println(msg); + fail(msg); + } + + if (!injectSNIROCallbacks(contentType, messageType, content, 10000)) { + fail("Failed to inject '" + action + "' workflow message"); + } + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + fail("Interrupted after injection of '" + action + "' workflow message"); + } + } + } + + /** + * Injects a sniro workflow message. The specified callback response may + * contain the placeholder strings ((CORRELATOR)) and ((SERVICE_RESOURCE_ID)) + * The ((CORRELATOR)) is replaced with the actual correlator value from the + * request. The ((SERVICE_RESOURCE_ID)) is replaced with the actual serviceResourceId + * value from the sniro request. Currently this only works with sniro request + * that contain only 1 resource. + * + * @param contentType the HTTP contentType for the message (possibly null) + * @param messageType the message type + * @param content the message content (possibly null) + * @param timeout the timeout in milliseconds + * @return true if the message could be injected, false otherwise + */ + protected boolean injectSNIROCallbacks(String contentType, String messageType, String content, long timeout) { + String correlator = (String) getProcessVariable("ReceiveWorkflowMessage", + messageType + "_CORRELATOR", timeout); + + if (correlator == null) { + return false; + } + if (content != null) { + content = content.replace("((CORRELATOR))", correlator); + if(messageType.equalsIgnoreCase("SNIROResponse")){ + //TODO figure out a solution for when there is more than 1 resource being homed (i.e. more than 1 reason in the placement list) + ServiceDecomposition decomp = (ServiceDecomposition) getProcessVariable("Homing", "serviceDecomposition", timeout); + List resourceList = decomp.getServiceResources(); + if(resourceList.size() == 1){ + String resourceId = ""; + for(Resource resource:resourceList){ + resourceId = resource.getResourceId(); + } + String homingList = getJsonValue(content, "solutionInfo.placement"); + JSONArray placementArr = new JSONArray(homingList); + if(placementArr.length() == 1){ + content = content.replace("((SERVICE_RESOURCE_ID))", resourceId); + } + String licenseInfoList = getJsonValue(content, "solutionInfo.licenseInfo"); + JSONArray licenseArr = new JSONArray(licenseInfoList); + if(licenseArr.length() == 1){ + content = content.replace("((SERVICE_RESOURCE_ID))", resourceId); + } + } + } + } + System.out.println("Injecting " + messageType + " message"); + WorkflowMessageResource workflowMessageResource = new WorkflowMessageResource(); + workflowMessageResource.setProcessEngineServices4junit(processEngineRule); + Response response = workflowMessageResource.deliver(contentType, messageType, correlator, content); + System.out.println("Workflow response to " + messageType + " message: " + response); + return true; + } + + /** * Wait for the process to end. * @param businessKey the process business key @@ -1477,8 +1617,6 @@ public class WorkflowTest { } /** - * @author cb645j - * * Gets the value of a subflow variable from the specified subflow's * historical process instance. * @@ -1517,8 +1655,6 @@ public class WorkflowTest { } /** - * @author cb645j - * * Gets the value of a subflow variable from the subflow's * historical process x instance. * diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java new file mode 100644 index 0000000000..4011a8f7e7 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIPServerTest.java @@ -0,0 +1,45 @@ +package org.openecomp.mso.client.aai; + +import java.io.File; +import java.io.IOException; +import java.security.NoSuchAlgorithmException; +import java.util.List; +import java.util.UUID; + +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; +import org.openecomp.aai.domain.yang.Pserver; +import static org.junit.Assert.assertEquals; +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; +public class AAIPServerTest { + + @BeforeClass + public static void setUp() { + System.setProperty("mso.config.path", "src/test/resources"); + System.setProperty("javax.net.ssl.keyStore", "C:/etc/ecomp/mso/config/msoClientKeyStore.jks"); + System.setProperty("javax.net.ssl.keyStorePassword", "mso4you"); + System.setProperty("javax.net.ssl.trustStore", "C:/etc/ecomp/mso/config/msoTrustStore.jks"); + System.setProperty("javax.net.ssl.trustStorePassword", "mso_Domain2.0_4you"); + } + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + public void pserverTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException { + AAIRestClientImpl client = new AAIRestClientImpl(); + File file = new File("src/test/resources/__files/AAI/pserver.json"); + List list = client.getListOfPservers(file); + + assertEquals("", list.get(0).getHostname(), "test"); + } + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + public void pserverActualTest() throws JsonParseException, JsonMappingException, IOException, NoSuchAlgorithmException { + AAIRestClientImpl client = new AAIRestClientImpl(); + List list = client.getPhysicalServerByVnfId("d946afed-8ebe-4c5d-9665-54fcc043b8e7", UUID.randomUUID().toString()); + assertEquals("", list.size(), 0); + } + +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java new file mode 100644 index 0000000000..bf1cb076e3 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/AAIValidatorTest.java @@ -0,0 +1,80 @@ + +package org.openecomp.mso.client.aai; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.List; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.openecomp.aai.domain.yang.GenericVnf; +import org.openecomp.aai.domain.yang.Pserver; + +import com.fasterxml.jackson.core.JsonParseException; +import com.fasterxml.jackson.databind.JsonMappingException; + +@RunWith(MockitoJUnitRunner.class) +public class AAIValidatorTest { + + @Mock + protected AAIRestClient client; + String vnfName = "testVnf"; + String uuid = "UUID"; + AAIValidatorImpl validator; + + @Before + public void init(){ + validator = new AAIValidatorImpl(); + validator.setClient(client); + } + + public List getPservers(boolean locked){ + Pserver pserver = new Pserver(); + pserver.setInMaint(locked); + List pservers = new ArrayList(); + pservers.add(pserver); + return pservers; + } + + public GenericVnf createGenericVnfs(boolean locked){ + GenericVnf genericVnf = new GenericVnf(); + genericVnf.setInMaint(locked); + + return genericVnf; + } + + @Test + public void test_IsPhysicalServerLocked_True() throws IOException{ + when(client.getPhysicalServerByVnfId(vnfName,uuid)).thenReturn(getPservers(true)); + boolean locked = validator.isPhysicalServerLocked(vnfName, uuid); + assertEquals(true, locked); + } + + @Test + public void test_IsPhysicalServerLocked_False() throws JsonParseException, JsonMappingException, UnsupportedEncodingException, IOException { + when(client.getPhysicalServerByVnfId(vnfName,uuid)).thenReturn(getPservers(false)); + boolean locked = validator.isPhysicalServerLocked(vnfName, uuid); + assertEquals(false, locked); + } + + @Test + public void test_IsVNFLocked_False() throws Exception{ + when(client.getVnfByName(vnfName,uuid)).thenReturn(createGenericVnfs(false)); + boolean locked = validator.isVNFLocked(vnfName, uuid); + assertEquals(false, locked); + } + + @Test + public void test_IsVNFLocked_True() throws Exception{ + when(client.getVnfByName(vnfName,uuid)).thenReturn(createGenericVnfs(true)); + boolean locked = validator.isVNFLocked(vnfName, uuid); + assertEquals(true,locked ); + } +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java new file mode 100644 index 0000000000..beb457497e --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/aai/EntitiesTest.java @@ -0,0 +1,21 @@ +package org.openecomp.mso.client.aai; + +import org.junit.Test; +import com.openpojo.validation.Validator; +import com.openpojo.validation.ValidatorBuilder; +import com.openpojo.validation.rule.impl.GetterMustExistRule; +import com.openpojo.validation.rule.impl.SetterMustExistRule; +import com.openpojo.validation.test.impl.GetterTester; +import com.openpojo.validation.test.impl.SetterTester; + +public class EntitiesTest { + + private String packageName = "org.openecomp.mso.client.aai.entities"; + + @Test + public void validate() { + Validator validator = ValidatorBuilder.create().with(new SetterMustExistRule(), new GetterMustExistRule()) + .with(new SetterTester(), new GetterTester()).build(); + validator.validate(packageName); + } +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java new file mode 100644 index 0000000000..3cc6b35b3a --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/appc/ApplicationControllerClientTest.java @@ -0,0 +1,78 @@ +package org.openecomp.mso.client.appc; + +import static org.junit.Assert.assertEquals; + +import java.util.Properties; +import java.util.UUID; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +import org.openecomp.appc.client.lcm.model.Action; +import org.openecomp.appc.client.lcm.model.ActionIdentifiers; +import org.openecomp.appc.client.lcm.model.CheckLockInput; +import org.openecomp.appc.client.lcm.model.Flags; +import org.openecomp.appc.client.lcm.model.Status; + +public class ApplicationControllerClientTest { + + private static ApplicationControllerClient client; + private static ApplicationControllerSupport support; + + @BeforeClass + public static void beforeClass() { + client = new ApplicationControllerClient(); + support = new ApplicationControllerSupport(); + client.appCSupport = support; + System.setProperty("mso.config.path", "src/test/resources"); + + } + + @AfterClass + public static void afterClass() throws Exception { + client.shutdownclient(); + } + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + public void createRequest_CheckLock_RequestBuilt() throws Exception { + + org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage", + "org.openecomp.appc.client.lcm.model"); + Flags flags = new Flags(); + ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); + actionIdentifiers.setVnfId("vnfId"); + CheckLockInput checkLockInput = (CheckLockInput) client.createRequest(Action.CheckLock, actionIdentifiers, + flags, null, "requestId"); + assertEquals(checkLockInput.getAction().name(), "CheckLock"); + } + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + public void runCommand_liveAppc() throws Exception { + org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage", + "org.openecomp.appc.client.lcm.model"); + Flags flags = new Flags(); + ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); + actionIdentifiers.setVnfId("ca522254-2ba4-4fbd-b15b-0ef0d9cfda5f"); + + // CheckLockInput checkLockInput = (CheckLockInput) + // client.createRequest(Action.CheckLock,actionIdentifiers,flags,null,"requestId"); + Status status = client.runCommand(Action.Lock, actionIdentifiers, flags, null, UUID.randomUUID().toString()); + assertEquals("Status of run command is correct", status.getCode(), 306); + } + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + public void runCommand_CheckLock_RequestBuilt() throws Exception { + org.springframework.test.util.ReflectionTestUtils.setField(support, "lcmModelPackage", + "org.openecomp.appc.client.lcm.model"); + Flags flags = new Flags(); + ActionIdentifiers actionIdentifiers = new ActionIdentifiers(); + actionIdentifiers.setVnfId("fusion-vpp-vnf-001"); + Status status = client.runCommand(Action.CheckLock, actionIdentifiers, flags, null, "requestId"); + assertEquals("Status of run command is correct", status.getCode(), 400); + } +} diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java new file mode 100644 index 0000000000..a369423ddc --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/java/org/openecomp/mso/client/policy/PolicyDecisionTest.java @@ -0,0 +1,50 @@ +package org.openecomp.mso.client.policy; + +import static org.junit.Assert.assertEquals; + +import java.io.IOException; +import java.util.Map; + +import org.junit.BeforeClass; +import org.junit.Ignore; +import org.junit.Test; + +public class PolicyDecisionTest { + + @BeforeClass + public static void setUp() { + System.setProperty("mso.config.path", "src/test/resources"); + } + @Test + public void successReadProperties() throws IOException, Exception { + PolicyRestClient client = new PolicyRestClient(); + Map headerMap = client.headerMap; + + assertEquals("Found expected Client Auth", headerMap.get("ClientAuth"), "Basic bTAzNzQzOnBvbGljeVIwY2sk"); + assertEquals("Found expected Authorization", headerMap.get("Authorization"), "Basic dGVzdHBkcDphbHBoYTEyMw=="); + assertEquals("Found expected Environment", headerMap.get("Environment"), "TEST"); + assertEquals("Has X-ECOMP-RequestID", headerMap.containsKey("X-ECOMP-RequestID"), true); + } + + @Test + @Ignore // IGNORED FOR 1710 MERGE TO ONAP + public void restEndpointCall() throws IOException, Exception { + PolicyRestClient client = new PolicyRestClient(); + PolicyDecision decision = client.getDecision("X", "Y", "BB1", "1", "123"); + assertEquals("Decision is correct", decision.getDecision(), "PERMIT"); + assertEquals("Decision details is correct", decision.getDetails(), "Abort"); + } +/* + @Test + public void failure() throws IOException, Exception { + when(dmaapConsumer.getMRConsumer()).thenReturn(mrConsumer); + when(mrConsumer.fetch()) + .thenReturn(Arrays.asList(new String[] { getJson("response.json"), getJson("output-failure.json") })); + + SDNOValidatorImpl validator = new SDNOValidatorImpl(); + thrown.expect(SDNOException.class); + thrown.expectMessage("my message"); + boolean result = validator.pollForResponse(dmaapConsumer, "xyz123"); + + }*/ +} diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policyAbortResponse.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policyAbortResponse.json new file mode 100644 index 0000000000..c315b1ed1d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policyAbortResponse.json @@ -0,0 +1 @@ +{"decision":"PERMIT","details":"Abort"} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policySkipResponse.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policySkipResponse.json new file mode 100644 index 0000000000..7cbdebb6b3 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/Policy/policySkipResponse.json @@ -0,0 +1 @@ +{"decision":"PERMIT","details":"Skip"} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/pserver.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/pserver.json new file mode 100644 index 0000000000..1a3f40aac3 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/aai/pserver.json @@ -0,0 +1,14 @@ +{ + "results": [ + { + "pserver": { + "hostname": "test" + } + }, + { + "pserver": { + "hostname": "test2" + } + } + ] +} \ No newline at end of file diff --git a/bpmn/MSOCommonBPMN/src/test/resources/__files/getCatalogServiceResourcesData.json b/bpmn/MSOCommonBPMN/src/test/resources/__files/getCatalogServiceResourcesData.json new file mode 100644 index 0000000000..a69d1b3622 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/test/resources/__files/getCatalogServiceResourcesData.json @@ -0,0 +1,57 @@ +{ + "serviceResources": { + "modelInfo": { + "modelName": "MOW AVPN vMX AV vPE Service", + "modelUuid": "b73c6911-be64-448a-bb4b-7b7a7006507a", + "modelInvariantUuid": "d48764b1-043d-4783-89e3-8816602dc833", + "modelVersion": "5.0" + }, + "serviceVnfs": [ + { + "modelInfo": { + "modelName": "MOW AVPN vMX AV vPE", + "modelUuid": "07bc0630-11d2-4c08-9c8f-75b036db1f4d", + "modelInvariantUuid": "31d077f6-356f-436e-b447-1997faff4c68", + "modelVersion": "3.0", + "modelCustomizationUuid": "16e5d513-1b96-4146-a325-af661d06eafd", + "modelInstanceName": "MOW AVPN vMX AV vPE 1" + }, + "toscaNodeType": null, + "nfFunction": null, + "nfType": null, + "nfRole": null, + "nfNamingCode": null, + "vfModules": [ + { + "modelInfo": { + "modelName": "MowAvpnVmxAvVpe..base_vRE_AV..module-0", + "modelUuid": "c91330e5-8e1a-459b-95ee-d682046cbeca", + "modelInvariantUuid": "f9f41064-cbe7-4e94-ac4c-93d9c54af317", + "modelVersion": "3", + "modelCustomizationUuid": "778c2ed5-77a8-426e-94fe-51a4d40199c3" + }, + "isBase": true, + "vfModuleLabel": "base_vRE_AV", + "initialCount": 1, + "hasVolumeGroup": true + }, + { + "modelInfo": { + "modelName": "MowAvpnVmxAvVpe..vPFE_AV..module-1", + "modelUuid": "ab5af099-03cb-4e74-92bf-44569099a666", + "modelInvariantUuid": "192faf79-7284-4a33-92d5-0be5b607ea43", + "modelVersion": "3", + "modelCustomizationUuid": "cb510af0-5b21-4bc7-86d9-323cb396ced3" + }, + "isBase": false, + "vfModuleLabel": "vPFE_AV", + "initialCount": 0, + "hasVolumeGroup": true + } + ] + } + ], + "serviceNetworks": [], + "serviceAllottedResources": [] + } +} diff --git a/bpmn/MSOCommonBPMN/src/test/resources/mso.bpmn.urn.properties b/bpmn/MSOCommonBPMN/src/test/resources/mso.bpmn.urn.properties index 1ac75e9456..c764c7f04e 100644 --- a/bpmn/MSOCommonBPMN/src/test/resources/mso.bpmn.urn.properties +++ b/bpmn/MSOCommonBPMN/src/test/resources/mso.bpmn.urn.properties @@ -9,9 +9,12 @@ mso.csi.pwd=4EA237303511EFBBC37F17A351562131 mso.csi.usrname=mso mso.msoKey=07a7159d3bf51a0e53be7a8f89699be7 +mso.healthcheck.log.debug=false + mso.adapters.completemsoprocess.endpoint=http://localhost:28090/CompleteMsoProcess mso.adapters.db.endpoint=http://localhost:28090/dbadapters/RequestsDbAdapter +mso.openecomp.adapters.db.endpoint=http://localhost:28090/dbadapters/RequestsDbAdapter mso.adapters.db.auth=757A94191D685FD2092AC1490730A4FC mso.adapters.network.endpoint=http://localhost:28090/networks/NetworkAdapter @@ -20,8 +23,22 @@ mso.adapters.network.rest.endpoint=http://localhost:28090/networks/NetworkAdapte mso.adapters.po.auth=757A94191D685FD2092AC1490730A4FC mso.adapters.po.password=3141634BF7E070AA289CF2892C986C0B mso.po.timeout=PT60S +mso.default.adapter.namespace=http://org.openecomp.mso + +aai.auth=26AFB797A6A57960D5D718491925C50F77CDC22AC394B3DBA09950D8FD1C0764 -aai.auth=757A94191D685FD2092AC1490730A4FC +policy.endpoint=https://mtanjvsgcvm02.nvp.cip.att.com:8081/pdp/api/getDecision +policy.client.auth=Basic bTAzNzQzOnBvbGljeVIwY2sk +policy.auth=Basic dGVzdHBkcDphbHBoYTEyMw== +policy.environment=TEST + +appc.topic.read=APPC-CL-FUSION-LCM-RESPONSE +appc.topic.read.timeout=60000 +appc.client.response.timeout=3600000 +appc.topic.write=APPC-CL-FUSION-LCM +appc.pool.members=uebsb91bodc.it.openecomp.org:3904,uebsb92bodc.it.openecomp.org:3904,uebsb93bodc.it.openecomp.org:3904 +appc.client.key=iaEMAfjsVsZnraBP +appc.client.secret=wcivUjsjXzmGFBfxMmyJu9dz mso.adapters.sdnc.endpoint=http://localhost:28090/SDNCAdapter mso.adapters.sdnc.rest.endpoint=http://localhost:28090/SDNCAdapter/v1/sdnc @@ -90,4 +107,9 @@ log.debug.GenericDeleteService=true log.debug.GenericDeleteNetwork=true log.debug.GenericDeleteVnf=true log.debug.vnfAdapterCreateV1=true -log.debug.vnfAdapterRestV1=true +log.debug.vnfAdapterRestV1=true + +policyClientAuth=Basic bTAzNzQzOnBvbGljeVIwY2sk +policyAuth=Basic dGVzdHBkcDphbHBoYTEyMw== +policyEnvironment=TEST +policyEndpoint=localhost:8080/pdp/api/getDecision -- cgit 1.2.3-korg