Query param to pull back nested stack information 31/84531/1
authorBenjamin, Max (mb388a) <mb388a@us.att.com>
Mon, 8 Apr 2019 13:52:32 +0000 (09:52 -0400)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Mon, 8 Apr 2019 13:53:04 +0000 (09:53 -0400)
Add Query param to pull back nested stack information

Change-Id: Idf83291107e2ef7e86bb2de914469b0401eda0ac
Issue-ID: SO-1760
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java
adapters/mso-openstack-adapters/src/test/resources/GetNestedResources.json [new file with mode: 0644]
adapters/mso-openstack-adapters/src/test/resources/GetResources.json
adapters/mso-openstack-adapters/src/test/resources/NestedExpectedValue.json [new file with mode: 0644]

index 0542340..300d06b 100644 (file)
@@ -1710,12 +1710,12 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{
 
        return vduStatus;
     }
-
-       public Resources queryStackResources(String cloudSiteId, String tenantId, String stackName) throws MsoException {
+    
+       public Resources queryStackResources(String cloudSiteId, String tenantId, String stackName, int nestedDepth) throws MsoException {
                CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId)
                                .orElseThrow(() -> new MsoCloudSiteNotFound(cloudSiteId));
                Heat heatClient = getHeatClient(cloudSite, tenantId);
-               OpenStackRequest<Resources> request = heatClient.getResources().listResources(stackName);
+               OpenStackRequest<Resources> request = heatClient.getResources().listResources(stackName).queryParam("nested_depth", nestedDepth);
                return executeAndRecordOpenstackRequest(request);
        }
 
index 31e913d..b522300 100644 (file)
@@ -68,7 +68,7 @@ public class HeatStackAudit {
        public Optional<AAIObjectAuditList> auditHeatStack(String cloudRegion, String cloudOwner, String tenantId, String heatStackName) {
                try {
                        logger.debug("Fetching Top Level Stack Information");
-                       Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName);
+                       Resources resources = heat.queryStackResources(cloudRegion, tenantId, heatStackName, 3);
                        List<Resource> novaResources = resources.getList().stream()
                                        .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());
                        List<Resource> resourceGroups = resources.getList().stream()
index a7744a2..e728cfd 100644 (file)
@@ -169,19 +169,34 @@ public class HeatStackAuditTest extends HeatStackAudit {
                
                String actualValue = objectMapper.writeValueAsString(vserversWithSubInterfaces);
                String expectedValue = getJson("ExpectedVserversToAudit.json");
-               System.out.println(actualValue);
                JSONAssert.assertEquals(expectedValue, actualValue, false);
        }
        
        @Test
        public void auditHeatStackNoServers_Test() throws Exception{
                Resources getResource = objectMapper.readValue(new File("src/test/resources/Service1ResourceGroupResponse.json"), Resources.class);
-               doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion,   tenantId, "heatStackName");
+               doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion,   tenantId, "heatStackName", 3);
                
                Optional<AAIObjectAuditList> actual = heatStackAudit.auditHeatStack(cloudRegion, "cloudOwner", tenantId, "heatStackName");
                assertEquals(true, actual.get().getAuditList().isEmpty());
        }
        
+       @Test
+       public void auditHeatStackNestedServers_Test() throws Exception{
+               Resources getResource = objectMapper.readValue(new File("src/test/resources/GetNestedResources.json"), Resources.class);                
+               List<Resource> novaResources = getResource.getList().stream()
+                               .filter(p -> "OS::Nova::Server".equals(p.getType())).collect(Collectors.toList());              
+               List<Resource> resourceGroups = getResource.getList().stream()
+                               .filter(p -> "OS::Heat::ResourceGroup".equals(p.getType())).collect(Collectors.toList());
+               
+               doReturn(getResource).when(msoHeatUtilsMock).queryStackResources(cloudRegion,   tenantId, "heatStackName", 3);          
+               Set<Vserver> vServersToAudit = heatStackAudit.createVserverSet(resources, novaResources,portList);              
+               Set<Vserver> vserversWithSubInterfaces = heatStackAudit.processSubInterfaces(cloudRegion,tenantId,resourceGroups, vServersToAudit);
+               String actualValue = objectMapper.writeValueAsString(vserversWithSubInterfaces);
+               String expectedValue = getJson("NestedExpectedValue.json");
+               JSONAssert.assertEquals(expectedValue, actualValue, false);
+       }
+       
 
        @Test
        public void findInterfaceInformation_Test(){
diff --git a/adapters/mso-openstack-adapters/src/test/resources/GetNestedResources.json b/adapters/mso-openstack-adapters/src/test/resources/GetNestedResources.json
new file mode 100644 (file)
index 0000000..73769d7
--- /dev/null
@@ -0,0 +1,277 @@
+{
+    "resources": [
+        {
+            "resource_name": "rar_keypair",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module/9b93aecf-fe05-4047-ba36-d5eb7bc7354e/resources/rar_keypair",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module/9b93aecf-fe05-4047-ba36-d5eb7bc7354e",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_keypair",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:49Z",
+            "required_by": [
+                "rar_node_0"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "rdm6ararf8001v-key_pair",
+            "resource_type": "OS::Nova::KeyPair"
+        },
+        {
+            "resource_name": "rar_node_0",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module/9b93aecf-fe05-4047-ba36-d5eb7bc7354e/resources/rar_node_0",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module/9b93aecf-fe05-4047-ba36-d5eb7bc7354e",
+                    "rel": "stack"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "nested"
+                }
+            ],
+            "logical_resource_id": "rar_node_0",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:49Z",
+            "required_by": [],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "c4876377-22bb-45d2-9fc3-f36a32207fa5",
+            "resource_type": "nest_rareport_server.yaml"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_volumeattachment_0",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_volumeattachment_0",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_volumeattachment_0",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "a27b9151-f439-437e-b7b0-94068cc856fa",
+            "resource_type": "OS::Cinder::VolumeAttachment"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_volume_0",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_volume_0",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_volume_0",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_volumeattachment_0"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "a27b9151-f439-437e-b7b0-94068cc856fa",
+            "resource_type": "OS::Cinder::Volume"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_RMM",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_RMM",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_RMM",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_server_0"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "dd23e047-d169-4cc3-a90a-6bc81b1ea17a",
+            "resource_type": "OS::Heat::MultipartMime"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_server_0",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_server_0",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_server_0",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_volumeattachment_0"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "03a31a65-91ed-4563-9d5d-4f7223df9767",
+            "resource_type": "OS::Nova::Server"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_RSC",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_RSC",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_RSC",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_RMM"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "7cea5faf-f5a8-4182-a686-05964f51ad95",
+            "resource_type": "OS::Heat::SoftwareConfig"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_0_oam_port_0",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_0_oam_port_0",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_0_oam_port_0",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_server_0"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "d2bc253c-96a5-47df-a00f-5b9f3eebe684",
+            "resource_type": "OS::Neutron::Port"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_RCC_2",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_RCC_2",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_RCC_2",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_RMM"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "15d092ab-4702-4635-8da9-24fff85c175b",
+            "resource_type": "OS::Heat::CloudConfig"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_RCC_0",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_RCC_0",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_RCC_0",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_RMM"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "9420ad4c-49da-4f23-89fc-109f9d5a4505",
+            "resource_type": "OS::Heat::CloudConfig"
+        },
+        {
+            "parent_resource": "rar_node_0",
+            "resource_name": "rar_RCC_1",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5/resources/rar_RCC_1",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module-rar_node_0-4pkqvamx52u6/c4876377-22bb-45d2-9fc3-f36a32207fa5",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_RCC_1",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:56Z",
+            "required_by": [
+                "rar_RMM"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "321b91fb-f265-4e56-8025-3c3e88da320a",
+            "resource_type": "OS::Heat::CloudConfig"
+        },
+        {
+            "resource_name": "rar_Sec_Grp",
+            "links": [
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module/9b93aecf-fe05-4047-ba36-d5eb7bc7354e/resources/rar_Sec_Grp",
+                    "rel": "self"
+                },
+                {
+                    "href": "https://test.com:8004/v1/326799122bd4451c801153f5db7f8509/stacks/rdm6ararf8001v_base_module/9b93aecf-fe05-4047-ba36-d5eb7bc7354e",
+                    "rel": "stack"
+                }
+            ],
+            "logical_resource_id": "rar_Sec_Grp",
+            "resource_status": "CREATE_COMPLETE",
+            "updated_time": "2019-04-02T20:13:49Z",
+            "required_by": [
+                "rar_node_0"
+            ],
+            "resource_status_reason": "state changed",
+            "physical_resource_id": "99fc77c6-019b-441c-ad99-b48dd1059f71",
+            "resource_type": "OS::Neutron::SecurityGroup"
+        }
+    ]
+}
\ No newline at end of file
index 3366ce4..0d403a6 100644 (file)
       "resource_status_reason": "state changed", 
       "resource_type": "OS::Heat::ResourceGroup", 
       "updated_time": "2019-01-23T19:34:15Z"
+    }, 
+    {
+      "resources": [
+        {
+          "links": [
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/1", 
+              "rel": "self"
+            }, 
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", 
+              "rel": "stack"
+            }, 
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", 
+              "rel": "nested"
+            }
+          ], 
+          "logical_resource_id": "1", 
+          "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces", 
+          "physical_resource_id": "0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", 
+          "required_by": [], 
+          "resource_name": "1", 
+          "resource_status": "CREATE_COMPLETE", 
+          "resource_status_reason": "state changed", 
+          "resource_type": "vlan_subinterface_ssc_service1.yaml", 
+          "updated_time": "2019-01-23T19:34:56Z"
+        }, 
+        {
+          "links": [
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/0", 
+              "rel": "self"
+            }, 
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", 
+              "rel": "stack"
+            }, 
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", 
+              "rel": "nested"
+            }
+          ], 
+          "logical_resource_id": "0", 
+          "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces", 
+          "physical_resource_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a", 
+          "required_by": [], 
+          "resource_name": "0", 
+          "resource_status": "CREATE_COMPLETE", 
+          "resource_status_reason": "state changed", 
+          "resource_type": "vlan_subinterface_ssc_service1.yaml", 
+          "updated_time": "2019-01-23T19:34:56Z"
+        }, 
+        {
+          "links": [
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/2", 
+              "rel": "self"
+            }, 
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", 
+              "rel": "stack"
+            }, 
+            {
+              "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", 
+              "rel": "nested"
+            }
+          ], 
+          "logical_resource_id": "2", 
+          "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces", 
+          "physical_resource_id": "bd0fc728-cbde-4301-a581-db56f494675c", 
+          "required_by": [], 
+          "resource_name": "2", 
+          "resource_status": "CREATE_COMPLETE", 
+          "resource_status_reason": "state changed", 
+          "resource_type": "vlan_subinterface_ssc_service1.yaml", 
+          "updated_time": "2019-01-23T19:34:56Z"
+        }
+      ]
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "d54dfd09-75c6-4e04-b204-909455b8f933", 
+      "required_by": [
+        "ssc_subint_service_1_vmi_0_v6_ip_0", 
+        "ssc_subint_service_1_vmi_0_ip_0"
+      ], 
+      "resource_name": "ssc_subint_service_1_vmi_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::VirtualMachineInterface", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0_v6_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0_v6_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service_1_vmi_0_v6_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service_1_vmi_0_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "f7a998c0-8939-4b07-bf4a-0862e9c325e1", 
+      "required_by": [
+        "ssc_subint_service_1_vmi_0_v6_ip_0", 
+        "ssc_subint_service_1_vmi_0_ip_0"
+      ], 
+      "resource_name": "ssc_subint_service_1_vmi_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::VirtualMachineInterface", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0_v6_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0_v6_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service_1_vmi_0_v6_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service_1_vmi_0_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "621c1fea-60b8-44ee-aede-c01b8b1aaa70", 
+      "required_by": [
+        "ssc_subint_service_1_vmi_0_v6_ip_0", 
+        "ssc_subint_service_1_vmi_0_ip_0"
+      ], 
+      "resource_name": "ssc_subint_service_1_vmi_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::VirtualMachineInterface", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0_v6_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0_v6_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service_1_vmi_0_v6_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service_1_vmi_0_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service_1_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service_1_vmi_0_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service_1_vmi_0_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources/0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c", 
+          "rel": "stack"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "nested"
+        }
+      ], 
+      "logical_resource_id": "0", 
+      "parent_resource": "ssc_1_subint_service2_port_0_subinterfaces", 
+      "physical_resource_id": "f711be16-2654-4a09-b89d-0511fda20e81", 
+      "required_by": [], 
+      "resource_name": "0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "vlan_subinterface_ssc_service2.yaml", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service2_vmi_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service2_vmi_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "2bbfa345-33bb-495a-94b2-fb514ee1cffc", 
+      "required_by": [
+        "ssc_subint_service2_vmi_0_v6_ip_0", 
+        "ssc_subint_service2_vmi_0_ip_0"
+      ], 
+      "resource_name": "ssc_subint_service2_vmi_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::VirtualMachineInterface", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service2_vmi_0_v6_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service2_vmi_0_v6_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service2_vmi_0_v6_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
+    }, 
+    {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service2_vmi_0_ip_0", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "ssc_subint_service2_vmi_0_ip_0", 
+      "parent_resource": "0", 
+      "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506", 
+      "required_by": [], 
+      "resource_name": "ssc_subint_service2_vmi_0_ip_0", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::ContrailV2::InstanceIp", 
+      "updated_time": "2019-01-23T19:34:56Z"
     }
   ]
 }
diff --git a/adapters/mso-openstack-adapters/src/test/resources/NestedExpectedValue.json b/adapters/mso-openstack-adapters/src/test/resources/NestedExpectedValue.json
new file mode 100644 (file)
index 0000000..337f3ce
--- /dev/null
@@ -0,0 +1 @@
+[{"vserverId":"03a31a65-91ed-4563-9d5d-4f7223df9767","linterfaces":{"linterface":[]}}]
\ No newline at end of file