aboutsummaryrefslogtreecommitdiffstats
path: root/so-simulator
diff options
context:
space:
mode:
Diffstat (limited to 'so-simulator')
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java8
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java15
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java7
4 files changed, 17 insertions, 19 deletions
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java
index 27d4ce78fd..56b27a1aea 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/DeleteVServers.java
@@ -1,9 +1,9 @@
package org.onap.so.simulator.actions.aai;
-import org.onap.aaiclient.client.aai.AAIObjectType;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.consol.citrus.actions.AbstractTestAction;
@@ -23,8 +23,8 @@ public class DeleteVServers extends AbstractTestAction {
String cloudRegion = context.getVariable("cloudRegion");
String cloudOwner = context.getVariable("cloudOwner");
String tenantId = context.getVariable("tenantId");
- AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, cloudOwner, cloudRegion,
- tenantId, vserverId);
+ AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.cloudInfrastructure()
+ .cloudRegion(cloudOwner, cloudRegion).tenant(tenantId).vserver(vserverId));
aaiResourceClient.delete(vserverURI);
logger.error("Delete Vservers in AAI: {}", vserverURI);
} catch (Exception e) {
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
index 21f9528f0f..b42441bcae 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessNetwork.java
@@ -1,10 +1,10 @@
package org.onap.so.simulator.actions.aai;
import org.onap.aai.domain.yang.L3Network;
-import org.onap.aaiclient.client.aai.AAIObjectType;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.consol.citrus.actions.AbstractTestAction;
@@ -23,7 +23,8 @@ public class ProcessNetwork extends AbstractTestAction {
if (context.getVariable("action").equals("assign")) {
String networkId = context.getVariable("generatedNetworkId");
- AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId);
+ AAIResourceUri networkURI =
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Network(networkId));
L3Network network = new L3Network();
network.setNetworkId(networkId);
network.setNetworkName(context.getVariable("networkName"));
@@ -33,7 +34,8 @@ public class ProcessNetwork extends AbstractTestAction {
aaiResourceClient.create(networkURI, network);
} else if (context.getVariable("action").equals("delete")) {
String networkId = context.getVariable("networkId");
- AAIResourceUri networkURI = AAIUriFactory.createResourceUri(AAIObjectType.L3_NETWORK, networkId);
+ AAIResourceUri networkURI =
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().l3Network(networkId));
aaiResourceClient.delete(networkURI);
}
} catch (Exception e) {
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
index d53de914a3..edf212429c 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/actions/aai/ProcessVnfc.java
@@ -1,18 +1,12 @@
package org.onap.so.simulator.actions.aai;
-import java.io.InputStream;
-import java.util.List;
import org.onap.aai.domain.yang.Vnfc;
-import org.onap.aai.domain.yang.Vserver;
-import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
-import org.onap.aaiclient.client.aai.AAIObjectType;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
-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.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.springframework.core.io.ClassPathResource;
import com.consol.citrus.actions.AbstractTestAction;
import com.consol.citrus.context.TestContext;
@@ -38,7 +32,8 @@ public class ProcessVnfc extends AbstractTestAction {
&& context.getVariable("serviceAction").equals("assign")
&& context.getVariable("vfModuleName").equals("nc_dummy_id")) {
- AAIResourceUri vnfcURI = AAIUriFactory.createResourceUri(AAIObjectType.VNFC, "ssc_server_1");
+ AAIResourceUri vnfcURI =
+ AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc("ssc_server_1"));
Vnfc vnfc = new Vnfc();
vnfc.setVnfcName("ssc_server_1");
vnfc.setNfcNamingCode("oamfw");
@@ -60,8 +55,8 @@ public class ProcessVnfc extends AbstractTestAction {
} else {
aaiResourceClient.get(vnfcURI);
}
- AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIObjectType.VF_MODULE,
- context.getVariable("vnfId"), context.getVariable("vfModuleId"));
+ AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network()
+ .genericVnf(context.getVariable("vnfId")).vfModule(context.getVariable("vfModuleId")));
logger.debug("creating VNFC edge to vf module");
aaiResourceClient.connect(vfModuleURI, vnfcURI);
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
index 371c72dca9..aa54a7a996 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/CreateAAInventory.java
@@ -3,10 +3,10 @@ package org.onap.so.simulator.scenarios.openstack;
import java.io.InputStream;
import org.onap.aai.domain.yang.Vserver;
import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider;
-import org.onap.aaiclient.client.aai.AAIObjectType;
import org.onap.aaiclient.client.aai.AAIResourcesClient;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
@@ -29,8 +29,9 @@ public class CreateAAInventory extends AbstractTestAction {
InputStream vserverFile =
new ClassPathResource("openstack/gr_api/CreateAAIInventory.json").getInputStream();
Vserver vserver = aaiMapper.getMapper().readValue(vserverFile, Vserver.class);
- AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(AAIObjectType.VSERVER, "cloudOwner",
- "regionOne", "0422ffb57ba042c0800a29dc85ca70f8", vServerId);
+ AAIResourceUri vserverURI = AAIUriFactory.createResourceUri(
+ AAIFluentTypeBuilder.cloudInfrastructure().cloudRegion("cloudOwner", "regionOne")
+ .tenant("0422ffb57ba042c0800a29dc85ca70f8").vserver(vServerId));
aaiResourceClient.create(vserverURI, vserver);
}
} catch (Exception e) {