aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src/main/groovy
diff options
context:
space:
mode:
authorBenjamin, Max <max.benjamin@att.com>2020-09-21 11:38:23 -0400
committerBenjamin, Max (mb388a) <mb388a@att.com>2020-09-23 16:32:42 -0400
commit2505a543b0e45c1c3c2fe2fb8b85664b08bf2fca (patch)
tree5f1593d45f8c9a2fb2d400b8fa58dbb3e29ef671 /bpmn/MSOCommonBPMN/src/main/groovy
parent8d68a316f303d0fc57eb7da4fef881a26d39d439 (diff)
removed references to AAIObjectType
removed references to AAIObjectType and AAIObjectPlurals additional corrections for removal of aai object type corrected additional java files updated groovy files to match aai fluent builder style Issue-ID: SO-3259 Signed-off-by: Benjamin, Max (mb388a) <mb388a@att.com> Change-Id: Ifdf12fcacb34cc648548eb18b638afd06dad67a9
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/groovy')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy23
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupName.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenant.groovy5
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModule.groovy15
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy4
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModule.groovy8
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy6
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy6
10 files changed, 50 insertions, 37 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy
index d85c387029..fe3686713a 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/AllottedResourceUtils.groovy
@@ -22,25 +22,24 @@
package org.onap.so.bpmn.common.scripts
-import org.onap.so.logger.LoggingAnchor
-import org.onap.aaiclient.client.aai.entities.AAIResultWrapper
-import org.onap.logging.filter.base.ErrorCode
-
import static org.apache.commons.lang3.StringUtils.isBlank;
-
import javax.ws.rs.NotFoundException
import javax.ws.rs.core.UriBuilder
-
import org.apache.commons.lang.StringUtils
import org.camunda.bpm.engine.delegate.BpmnError
import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.aai.domain.yang.AllottedResource
-import org.onap.so.bpmn.core.WorkflowException
-import org.onap.so.client.PreconditionFailedException
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.AAIResourcesClient
+import org.onap.aaiclient.client.aai.entities.AAIResultWrapper
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
+import org.onap.logging.filter.base.ErrorCode
+import org.onap.so.bpmn.core.WorkflowException
+import org.onap.so.client.PreconditionFailedException
+import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -115,7 +114,7 @@ class AllottedResourceUtils {
public boolean ifExistsAR(DelegateExecution execution, String allottedResourceId) {
logger.trace("ifExistsAR ")
try {
- AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.ALLOTTED_RESOURCE, allottedResourceId)
+ AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(Types.ALLOTTED_RESOURCE.getFragment(allottedResourceId))
AAIResultWrapper wrapper = getAAIClient().get(resourceUri)
Optional<AllottedResource> allottedResource = wrapper.asBean(AllottedResource.class)
if(allottedResource.isPresent()) {
@@ -150,7 +149,7 @@ class AllottedResourceUtils {
Optional<AllottedResource> allottedResource = Optional.empty()
try {
logger.debug("GET AR Aai Path is: \n" + link)
- AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.ALLOTTED_RESOURCE, UriBuilder.fromPath(link).build())
+ AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(Types.ALLOTTED_RESOURCE, UriBuilder.fromPath(link).build())
allottedResource = getAAIClient().get(AllottedResource.class,uri);
if(allottedResource.isPresent()) {
if (!isBlank(role)) {
@@ -193,7 +192,7 @@ class AllottedResourceUtils {
allottedResource.setOrchestrationStatus(status)
logger.debug('AAI AR URI: ' + aaiARPath)
- AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.ALLOTTED_RESOURCE, UriBuilder.fromPath(aaiARPath).build())
+ AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(Types.ALLOTTED_RESOURCE, UriBuilder.fromPath(aaiARPath).build())
getAAIClient().update(uri,allottedResource)
}catch(Exception e){
logger.error(LoggingAnchor.FIVE, MessageEnum.BPMN_GENERAL_EXCEPTION_ARG.toString(),
@@ -208,7 +207,7 @@ class AllottedResourceUtils {
logger.trace(" deleteAR - aaiARPath:" + aaiARPath)
try {
- AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(AAIObjectType.ALLOTTED_RESOURCE, UriBuilder.fromPath(aaiARPath).build())
+ AAIResourceUri uri = AAIUriFactory.createResourceFromExistingURI(Types.ALLOTTED_RESOURCE, UriBuilder.fromPath(aaiARPath).build())
getAAIClient().delete(uri);
}catch(NotFoundException ex){
logger.debug(" Delete AR Received a Not Found (404) Response")
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupName.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupName.groovy
index c5a0e46fe5..2f09ca2aa0 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupName.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupName.groovy
@@ -29,6 +29,8 @@ import org.onap.aai.domain.yang.VolumeGroup
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.onap.so.constants.Defaults
import org.onap.logging.filter.base.ErrorCode
import org.onap.so.logger.LoggingAnchor
@@ -74,7 +76,7 @@ public class ConfirmVolumeGroupName extends AbstractServiceTaskProcessor{
execution.setVariable("CVGN_volumeGroupName", volumeGroupName)
execution.setVariable("CVGN_aicCloudRegion", aicCloudRegion)
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), aicCloudRegion, volumeGroupId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(Defaults.CLOUD_OWNER.toString(), aicCloudRegion).volumeGroup(volumeGroupId))
execution.setVariable("CVGN_volumeGroupGetEndpoint", uri)
}
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenant.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenant.groovy
index f5cf541076..fce9286164 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenant.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/ConfirmVolumeGroupTenant.groovy
@@ -31,6 +31,7 @@ import org.onap.aaiclient.client.aai.entities.Relationships
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.onap.logging.filter.base.ErrorCode
import org.onap.so.constants.Defaults
import org.onap.so.logger.LoggingAnchor
@@ -62,7 +63,7 @@ class ConfirmVolumeGroupTenant extends AbstractServiceTaskProcessor{
String incomingGroupName = execution.getVariable("volumeGroupName")
String incomingTenantId = execution.getVariable("tenantId")
String aicCloudRegion = execution.getVariable("aicCloudRegion")
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, Defaults.CLOUD_OWNER.toString(), aicCloudRegion, volumeGroupId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(Defaults.CLOUD_OWNER.toString(), aicCloudRegion).volumeGroup(volumeGroupId))
AAIResultWrapper wrapper = getAAIClient().get(uri);
Optional<VolumeGroup> volumeGroup = wrapper.asBean(VolumeGroup.class)
Optional<Relationships> relationships = wrapper.getRelationships()
@@ -70,7 +71,7 @@ class ConfirmVolumeGroupTenant extends AbstractServiceTaskProcessor{
execution.setVariable("queryAAIVolumeGroupResponse", volumeGroup.get())
String volumeGroupTenantId = ""
if(relationships.isPresent()){
- List<AAIResourceUri> tenantUris = relationships.get().getRelatedAAIUris(AAIObjectType.TENANT)
+ List<AAIResourceUri> tenantUris = relationships.get().getRelatedUris(Types.TENANT)
for (AAIResourceUri tenantURI: tenantUris){
volumeGroupTenantId = tenantURI.getURIKeys().get(AAIFluentTypeBuilder.Types.TENANT.getUriParams().tenantId)
}
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 9758c126a9..40b9388418 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
@@ -26,14 +26,13 @@ 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.aaiclient.client.aai.AAIObjectPlurals
-import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
import org.onap.aaiclient.client.graphinventory.entities.uri.Depth
-import org.onap.so.db.catalog.beans.OrchestrationStatus
import org.onap.logging.filter.base.ErrorCode
+import org.onap.so.bpmn.core.RollbackData
+import org.onap.so.db.catalog.beans.OrchestrationStatus
import org.onap.so.logger.LoggingAnchor
import org.onap.so.logger.MessageEnum
import org.slf4j.Logger
@@ -154,9 +153,9 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
def vnfName = execution.getVariable("CAAIVfMod_vnfName")
Optional<GenericVnf> genericVnfOp
if (vnfId == null || vnfId.isEmpty()) {
- genericVnfOp = getAAIClient().getFirst(GenericVnfs.class, GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectPlurals.GENERIC_VNF).queryParam("vnf-name", vnfName).depth(Depth.ONE))
+ genericVnfOp = getAAIClient().getFirst(GenericVnfs.class, GenericVnf.class, AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnfs()).queryParam("vnf-name", vnfName).depth(Depth.ONE))
} else {
- genericVnfOp = getAAIClient().get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId))
+ genericVnfOp = getAAIClient().get(GenericVnf.class, AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId)))
}
try {
if(genericVnfOp.isPresent()){
@@ -214,7 +213,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
genericVnf.setModelVersionId(execution.getVariable("CAAIVfMod_vnfPersonaVer"))
try {
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, newVnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(newVnfId))
getAAIClient().create(uri,genericVnf)
execution.setVariable("CAAIVfMod_createGenericVnfResponseCode", 201)
execution.setVariable("CAAIVfMod_createGenericVnfResponse", "Vnf Created")
@@ -266,7 +265,7 @@ public class CreateAAIVfModule extends AbstractServiceTaskProcessor{
try {
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, newModuleId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(newModuleId))
getAAIClient().create(uri,vfModule)
def statusCode = 201
execution.setVariable("CAAIVfMod_createVfModuleResponseCode", statusCode)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy
index 8a74307df6..511cd8d6e6 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/CreateAAIVfModuleVolumeGroup.groovy
@@ -27,6 +27,8 @@ import org.camunda.bpm.engine.delegate.DelegateExecution
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -111,7 +113,7 @@ public class CreateAAIVfModuleVolumeGroup extends AbstractServiceTaskProcessor {
def vnfId = execution.getVariable('CAAIVfModVG_vnfId')
def vfModuleId = execution.getVariable('CAAIVfModVG_vfModuleId')
try {
- AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId);
+ AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId));
Optional<org.onap.aai.domain.yang.VfModule> vfModule = getAAIClient().get(org.onap.aai.domain.yang.VfModule.class, resourceUri)
if(vfModule.isPresent()){
execution.setVariable('CAAIVfModVG_getVfModuleResponseCode', 200)
@@ -164,8 +166,8 @@ public class CreateAAIVfModuleVolumeGroup extends AbstractServiceTaskProcessor {
def volumeGroupId = execution.getVariable('CAAIVfModVG_volumeGroupId')
try {
- AAIResourceUri vfModuleUri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId,vfModuleId);
- AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIObjectType.VOLUME_GROUP, cloudOwner, aicCloudRegion,volumeGroupId);
+ AAIResourceUri vfModuleUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId));
+ AAIResourceUri volumeGroupUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion(cloudOwner, aicCloudRegion).volumeGroup(volumeGroupId));
logger.debug("Creating relationship between Vf Module: " + vfModuleUri.build().toString() + " and Volume Group: " + volumeGroupUri.build().toString())
getAAIClient().connect(vfModuleUri,volumeGroupUri)
execution.setVariable('CAAIVfModVG_updateVfModuleResponseCode', 200)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy
index 8c6ebefc49..02d0cd0287 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/DeleteAAIVfModule.groovy
@@ -28,6 +28,8 @@ import org.onap.aai.domain.yang.GenericVnf
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.onap.aaiclient.client.graphinventory.entities.uri.Depth
import org.onap.logging.filter.base.ErrorCode
import org.onap.so.logger.MessageEnum
@@ -83,7 +85,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
try {
AaiUtil aaiUriUtil = new AaiUtil(this)
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
uri.depth(Depth.ONE)
Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class, uri)
@@ -109,7 +111,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
try {
String vnfId = execution.getVariable("DAAIVfMod_vnfId")
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
getAAIClient().delete(uri)
execution.setVariable("DAAIVfMod_deleteGenericVnfResponseCode", 200)
execution.setVariable("DAAIVfMod_deleteGenericVnfResponse", "Vnf Deleted")
@@ -126,7 +128,7 @@ public class DeleteAAIVfModule extends AbstractServiceTaskProcessor{
String vnfId = execution.getVariable("DAAIVfMod_vnfId")
String vfModuleId = execution.getVariable("DAAIVfMod_vfModuleId")
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId))
getAAIClient().delete(uri)
execution.setVariable("DAAIVfMod_deleteVfModuleResponseCode", 200)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy
index 9593aa15be..63dd9af117 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/GenerateVfModuleName.groovy
@@ -41,6 +41,8 @@ import org.onap.so.client.HttpClient
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.onap.aaiclient.client.graphinventory.entities.uri.Depth
import org.onap.logging.filter.base.ONAPComponents;
import org.onap.so.logger.MessageEnum
@@ -85,7 +87,7 @@ public class GenerateVfModuleName extends AbstractServiceTaskProcessor{
def personaModelId = execution.getVariable('personaModelId')
AaiUtil aaiUtil = new AaiUtil(this)
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
uri.depth(Depth.ONE)
String endPoint = aaiUtil.createAaiUri(uri)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModule.groovy
index 051f69381a..f7fbc3a371 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModule.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/PrepareUpdateAAIVfModule.groovy
@@ -35,6 +35,8 @@ import org.onap.aaiclient.client.aai.AAIResourcesClient
import org.onap.aaiclient.client.aai.entities.AAIResultWrapper
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.onap.aaiclient.client.graphinventory.entities.uri.Depth
import org.springframework.web.util.UriUtils
import org.onap.so.logger.MessageEnum
@@ -123,7 +125,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
try {
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
AAIResourcesClient resourceClient = new AAIResourcesClient()
AAIResultWrapper wrapper = resourceClient.get(uri.depth(Depth.ONE), NotFoundException.class)
GenericVnf responseData = wrapper.asBean(GenericVnf.class).get()
@@ -167,7 +169,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
def vnfName = genericVnf.getVnfName()
execution.setVariable('PUAAIVfMod_vnfName', vnfName)
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId))
AAIResourcesClient resourceClient = new AAIResourcesClient()
@@ -224,7 +226,7 @@ public class PrepareUpdateAAIVfModule extends VfModuleBase {
vfModule.setOrchestrationStatus(orchestrationStatus)
AAIResourcesClient client = new AAIResourcesClient()
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId))
client.update(uri, vfModule)
execution.setVariable('PUAAIVfMod_updateVfModuleResponseCode', 200)
// Set the output for this flow. The updated VfModule is an output, the generic VNF name, and for
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
index 9a78472540..b68bf7bfab 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIGenericVnf.groovy
@@ -30,6 +30,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.onap.aaiclient.client.graphinventory.entities.uri.Depth
import org.onap.logging.filter.base.ErrorCode
import org.onap.so.logger.MessageEnum
@@ -134,7 +136,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor {
try {
def vnfId = execution.getVariable('UAAIGenVnf_vnfId')
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
uri.depth(Depth.ONE)
try {
Optional<GenericVnf> genericVnf = getAAIClient().get(GenericVnf.class,uri)
@@ -223,7 +225,7 @@ public class UpdateAAIGenericVnf extends AbstractServiceTaskProcessor {
payload.setManagementV6Address(managementV6AddressEntry)
payload.setOrchestrationStatus(orchestrationStatusEntry)
- AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId)
+ AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId))
try {
getAAIClient().update(uri,payload)
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy
index 20f9721b2e..a8a289d4cb 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/UpdateAAIVfModule.groovy
@@ -30,6 +30,8 @@ import org.onap.so.bpmn.core.WorkflowException
import org.onap.aaiclient.client.aai.AAIObjectType
import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder
+import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types
import org.slf4j.Logger
import org.slf4j.LoggerFactory
@@ -106,7 +108,7 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor {
def vnfId = execution.getVariable('UAAIVfMod_vnfId')
def vfModuleId = execution.getVariable('UAAIVfMod_vfModuleId')
try {
- AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId);
+ AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId));
Optional<org.onap.aai.domain.yang.VfModule> vfModule = getAAIClient().get(org.onap.aai.domain.yang.VfModule.class, resourceUri)
if (vfModule.isPresent()) {
execution.setVariable('UAAIVfMod_getVfModuleResponseCode', 200)
@@ -185,7 +187,7 @@ public class UpdateAAIVfModule extends AbstractServiceTaskProcessor {
payload.setContrailServiceInstanceFqdn(contrailServiceInstanceFqdnEntry)
try {
- AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE, vnfId, vfModuleId)
+ AAIResourceUri resourceUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId).vfModule(vfModuleId))
getAAIClient().update(resourceUri, payload)
execution.setVariable('UAAIVfMod_updateVfModuleResponseCode', 200)
execution.setVariable('UAAIVfMod_updateVfModuleResponse', "Success")