Remove resources that are not neutron networks 60/78160/1
authorBenjamin, Max (mb388a) <mb388a@us.att.com>
Fri, 8 Feb 2019 22:40:25 +0000 (17:40 -0500)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Fri, 8 Feb 2019 22:42:55 +0000 (17:42 -0500)
Remove resources that are not neutron networks

Change-Id: Ie136895f95273e53f86201fe3b58a12fa27c8fe6
Issue-ID: SO-1486
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java
adapters/mso-openstack-adapters/src/test/resources/GetResources.json

index 7bba136..9743153 100644 (file)
@@ -162,7 +162,8 @@ public class HeatStackAudit {
                        auditVserver.setLInterfaces(new LInterfaces());
                        auditVserver.setVserverId(novaResource.getPhysicalResourceId());
                        Stream<Resource> filteredNeutronNetworks = resources.getList().stream()
-                                       .filter(network -> network.getRequiredBy().contains(novaResource.getLogicalResourceId()));
+                                       .filter(resource -> resource.getRequiredBy().contains(novaResource.getLogicalResourceId()))
+                                       .filter(resource -> "OS::Neutron::Port".equals(resource.getType()));
                        filteredNeutronNetworks.forEach(network -> {
                                LInterface lInterface = new LInterface();
                                lInterface.setInterfaceId(network.getPhysicalResourceId());
index 6e2bad3..22e66d4 100644 (file)
@@ -1,5 +1,27 @@
 {
     "resources": [
+      {
+      "links": [
+        {
+          "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732/resources/vlbagent_eph_aff_id", 
+          "rel": "self"
+        }, 
+        {
+          "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732", 
+          "rel": "stack"
+        }
+      ], 
+      "logical_resource_id": "vlbagent_eph_aff_id", 
+      "physical_resource_id": "zdyh3brlba05_addon-vlbagent_eph_aff_id-euhxoicxsgso", 
+      "required_by": [
+        "ssc_server_1"
+      ], 
+      "resource_name": "vlbagent_eph_aff_id", 
+      "resource_status": "CREATE_COMPLETE", 
+      "resource_status_reason": "state changed", 
+      "resource_type": "OS::Heat::RandomString", 
+      "updated_time": "2019-02-07T22:56:12Z"
+    }, 
         {
             "resource_name": "ssc_1_trusted_port_0",
             "links": [
             "resource_type": "OS::Heat::ResourceGroup"
         }
     ]
-}
\ No newline at end of file
+}