support alloc pool from dhcpStart/end 64/76364/1
authorBenjamin, Max (mb388a) <mb388a@us.att.com>
Fri, 25 Jan 2019 18:19:17 +0000 (13:19 -0500)
committerBenjamin, Max (mb388a) <mb388a@us.att.com>
Fri, 25 Jan 2019 18:19:33 +0000 (13:19 -0500)
Fix to include alloc pool from dhcpStart End on reqs

Change-Id: I6df666d80d48e1a87198b64ef7397b9c4739090a
Issue-ID: SO-1427
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/network/mapper/NetworkAdapterObjectMapper.java
bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/createNetworkRequest.json
bpmn/so-bpmn-tasks/src/test/resources/__files/BuildingBlocks/NetworkMapper/generalBB.json

index 4c84ee4..f917aed 100644 (file)
@@ -283,6 +283,14 @@ public class NetworkAdapterObjectMapper {
                                //add host route to the list
                                openstackHostRouteList.add(openstackHostRoute);
                        }
+                       if (subnet.getDhcpStart() != null && !subnet.getDhcpStart().equals("")) {
+                               org.onap.so.openstack.beans.Pool openstackAllocationPool = new org.onap.so.openstack.beans.Pool();
+                               openstackAllocationPool.setStart(subnet.getDhcpStart());
+                               openstackAllocationPool.setEnd(subnet.getDhcpEnd());
+                               List<org.onap.so.openstack.beans.Pool> allocationPools = new ArrayList<>();
+                               allocationPools.add(openstackAllocationPool);
+                               openstackSubnet.setAllocationPools(allocationPools);
+                       }
                        openstackSubnet.setHostRoutes(openstackHostRouteList);
                        //add subnet to the list
                        subnetList.add(openstackSubnet);
index a9cef56..d7e282d 100644 (file)
       "cidr": "107.244.64.2/20",
       "gatewayIp": "107.244.64.1",
       "ipVersion": "4",
-      "enableDHCP": false,
+      "enableDHCP": true,
       "addrFromStart": true,
-      "hostRoutes": []
+      "hostRoutes": [],
+      "allocationPools": [{
+               "start": "107.244.64.2",
+               "end": "107.244.64.16"
+               }]      
     }
   ],
   "providerVlanNetwork": {
index 6c6981b..e0b3bc4 100644 (file)
@@ -64,9 +64,9 @@
         "cidr-mask" : "20",
         "ip-version" : "4",
         "orchestration-status" : null,
-        "dhcp-enabled" : false,
-        "dhcp-start" : "",
-        "dhcp-end" : "",
+        "dhcp-enabled" : true,
+        "dhcp-start" : "107.244.64.2",
+        "dhcp-end" : "107.244.64.16",
         "subnet-role" : "",
         "ip-assignment-direction" : "true",
         "subnet-sequence" : null,