summaryrefslogtreecommitdiffstats
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/ProcessVnfc.java15
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java25
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java26
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java6
-rw-r--r--so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java6
-rw-r--r--so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json122
8 files changed, 192 insertions, 20 deletions
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 edf212429c..d8d62d99bc 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
@@ -29,8 +29,7 @@ public class ProcessVnfc extends AbstractTestAction {
AAIResourcesClient aaiResourceClient = new AAIResourcesClient();
if (context.getVariable("requestAction").equals("CreateVfModuleInstance")
- && context.getVariable("serviceAction").equals("assign")
- && context.getVariable("vfModuleName").equals("nc_dummy_id")) {
+ && context.getVariable("serviceAction").equals("assign")) {
AAIResourceUri vnfcURI =
AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().vnfc("ssc_server_1"));
@@ -47,14 +46,14 @@ public class ProcessVnfc extends AbstractTestAction {
vnfc.setModelVersionId("9e314c37-2258-4572-a399-c0dd7d5f1aec");
vnfc.setModelCustomizationId("2bd95cd4-d7ff-4af0-985d-2adea0339921");
- if (!aaiResourceClient.exists(vnfcURI)) {
- logger.debug("creating VNFC");
- aaiResourceClient.create(vnfcURI, vnfc);
+ if (aaiResourceClient.exists(vnfcURI)) {
+ logger.debug("cleaning up VNFC");
+ aaiResourceClient.delete(vnfcURI);
+ }
+ logger.debug("creating new VNFC");
+ aaiResourceClient.create(vnfcURI, vnfc);
- } else {
- aaiResourceClient.get(vnfcURI);
- }
AAIResourceUri vfModuleURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network()
.genericVnf(context.getVariable("vnfId")).vfModule(context.getVariable("vfModuleId")));
logger.debug("creating VNFC edge to vf module");
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java
new file mode 100644
index 0000000000..f4ac519f7a
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplace.java
@@ -0,0 +1,25 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Replace-ID-Name-Resources")
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module/stackId/resources", method = RequestMethod.GET)
+public class QueryResourcesByStackNameModuleReplace extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "replace_module");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
new file mode 100644
index 0000000000..f6eebeb09e
--- /dev/null
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/QueryResourcesByStackNameModuleReplaceVolume.java
@@ -0,0 +1,26 @@
+package org.onap.so.simulator.scenarios.openstack;
+
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import com.consol.citrus.simulator.scenario.AbstractSimulatorScenario;
+import com.consol.citrus.simulator.scenario.Scenario;
+import com.consol.citrus.simulator.scenario.ScenarioDesigner;
+
+@Scenario("Query-Replace-Volume-ID-Name-Resources")
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/replace_module_volume_id/stackId/resources",
+ method = RequestMethod.GET)
+public class QueryResourcesByStackNameModuleReplaceVolume extends AbstractSimulatorScenario {
+
+ @Override
+ public void run(ScenarioDesigner scenario) {
+ scenario.http().receive().get();
+
+ scenario.variable("stackName", "replace_module_volume_id");
+
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
+
+ }
+}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
index e13a23f397..eb306ccd6f 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro1.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro1")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_1/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro1 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
index 580714ded2..d2551a2fb3 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro2.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro2")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_2/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro2 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
index 096d2aa312..bb33f2c718 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/macro/QueryResourcesByStackNameMacro3.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Stack-Resources-Macro3")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/macro_module_3/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
@@ -17,8 +17,8 @@ public class QueryResourcesByStackNameMacro3 extends AbstractSimulatorScenario {
public void run(ScenarioDesigner scenario) {
scenario.http().receive().get();
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResourcesMacro.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
index b590966e2f..77cc0054cc 100644
--- a/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
+++ b/so-simulator/src/main/java/org/onap/so/simulator/scenarios/openstack/resources/QueryResourcesByBaseStackName.java
@@ -9,7 +9,7 @@ import com.consol.citrus.simulator.scenario.Scenario;
import com.consol.citrus.simulator.scenario.ScenarioDesigner;
@Scenario("Openstack-Query-Base-Stack-Resources")
-@RequestMapping(value = "/sim/v1/tenantOne/stacks/base_module_id/resources", method = RequestMethod.GET)
+@RequestMapping(value = "/sim/v1/tenantOne/stacks/base_module_id/stackId/resources", method = RequestMethod.GET)
public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
@@ -19,8 +19,8 @@ public class QueryResourcesByBaseStackName extends AbstractSimulatorScenario {
scenario.variable("stackName", "dummy_id");
- scenario.http().send().response(HttpStatus.OK)
- .payload(new ClassPathResource("openstack/gr_api/GetStackResources.json"));
+ scenario.http().send().response(HttpStatus.OK).header("ContentType", "application/json")
+ .payload(new ClassPathResource("openstack/gr_api/zrdm52emccr01_base_resources.json"));
}
diff --git a/so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json b/so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json
new file mode 100644
index 0000000000..0a47889c33
--- /dev/null
+++ b/so-simulator/src/main/resources/openstack/gr_api/zrdm52emccr01_base_resources.json
@@ -0,0 +1,122 @@
+{
+ "resources" : [ {
+ "resource_name" : "oam_security_group",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/oam_security_group",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "f83b7f23-ce5e-41bf-8dbf-ae53e905db7c",
+ "logical_resource_id" : "oam_security_group",
+ "required_by" : [ "cpm_0_oam_protected1_port_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::SecurityGroup",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_base2_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_base2_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "803b18b6-e9ba-4fe8-93eb-4a68832b2869",
+ "logical_resource_id" : "cpm_0_sd_base2_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_base1_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_base1_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "56610b2d-6e58-451b-9eb7-5f516f85a458",
+ "logical_resource_id" : "cpm_0_sd_base1_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_eastwest2_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_eastwest2_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "67aaf2a1-2ada-4322-8603-dceec9b456a6",
+ "logical_resource_id" : "cpm_0_sd_eastwest2_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_sd_eastwest1_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_sd_eastwest1_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "8b5392c9-d3aa-41f4-85ee-a3223182e455",
+ "logical_resource_id" : "cpm_0_sd_eastwest1_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_0_oam_protected1_port_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_0_oam_protected1_port_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "4eec349e-be73-41ae-9457-69d31f3a9305",
+ "logical_resource_id" : "cpm_0_oam_protected1_port_0",
+ "required_by" : [ "cpm_server_0" ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Neutron::Port",
+ "resource_status_reason" : "state changed"
+ }, {
+ "resource_name" : "cpm_server_0",
+ "links" : [ {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e/resources/cpm_server_0",
+ "rel" : "self"
+ }, {
+ "href" : "https://test.onap.org/v1/c162d85d27d54186b699935fd535c57a/stacks/stack_name/cb5e288d-e21f-49ee-87d0-5a2bd6be446e",
+ "rel" : "stack"
+ } ],
+ "resource_status" : "CREATE_COMPLETE",
+ "physical_resource_id" : "635a609d-bb2b-446c-b955-8fc5a4ba4b8d",
+ "logical_resource_id" : "cpm_server_0",
+ "required_by" : [ ],
+ "updated_time" : "2019-05-28T15:19:10Z",
+ "creation_time" : "2019-05-28T15:19:10Z",
+ "resource_type" : "OS::Nova::Server",
+ "resource_status_reason" : "state changed"
+ } ]
+} \ No newline at end of file