diff options
author | Benjamin, Max <max.benjamin@att.com> | 2020-03-16 12:01:26 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@att.com> | 2020-03-16 12:01:26 -0400 |
commit | a577f75663e5c8ccddee54337328425c5b2361d2 (patch) | |
tree | 3d666976eb291a0e1f558174bfa2341709ae6956 /bpmn/MSOCommonBPMN/src/main/groovy | |
parent | 7e2f7db5b4007fe470a7ce5794c88d1844021410 (diff) |
split single and plural graph inventory uris
split single and plural graph inventory uris
updated all object references in MSO using graph inventory plurals
corrected unit test stubbings
added additional unit tests
correct interfaces to return plural after related-to
modified the way http aware uris are built
reformated interfaces to no longer duplicate methods
corrected issues with identity of unbuilt uris
removed AAIUri references from groovy files
fixed clone behavior on Uri objects
Issue-ID: SO-2743
Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com>
Change-Id: I37aa2a13dcbf010b6c82ad73af3be5db5d9bd673
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/groovy')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy index b43a153acb..c0124cfd50 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy @@ -22,10 +22,10 @@ package org.onap.so.bpmn.common.scripts -import org.onap.so.logger.LoggingAnchor import org.apache.commons.lang.StringUtils import org.camunda.bpm.engine.delegate.DelegateExecution import org.onap.aai.domain.yang.GenericVnf +import org.onap.aai.domain.yang.GenericVnfs import org.onap.so.bpmn.core.RollbackData import org.onap.so.client.aai.AAIObjectPlurals import org.onap.so.client.aai.AAIObjectType @@ -34,6 +34,7 @@ import org.onap.so.client.aai.entities.uri.AAIUriFactory import org.onap.so.client.graphinventory.entities.uri.Depth import org.onap.so.db.catalog.beans.OrchestrationStatus import org.onap.logging.filter.base.ErrorCode +import org.onap.so.logger.LoggingAnchor import org.onap.so.logger.MessageEnum import org.slf4j.Logger import org.slf4j.LoggerFactory @@ -151,15 +152,13 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{ AAIResourceUri uri def vnfId = execution.getVariable("CAAIVfMod_vnfId") def vnfName = execution.getVariable("CAAIVfMod_vnfName") + Optional<GenericVnf> genericVnfOp if (vnfId == null || vnfId.isEmpty()) { - uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF) - uri.queryParam("vnf-name", vnfName) + genericVnfOp = getAAIClient().getFirst(GenericVnfs.class, GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE)) } else { - uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId) + genericVnfOp = getAAIClient().get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)) } - uri.depth(Depth.ONE) try { - Optional<GenericVnf> genericVnfOp = getAAIClient().get(GenericVnf.class, uri) if(genericVnfOp.isPresent()){ execution.setVariable("CAAIVfMod_queryGenericVnfResponseCode", 200) execution.setVariable("CAAIVfMod_queryGenericVnfResponse", genericVnfOp.get()) |