kioie commented on a change in pull request #3997:
URL: https://github.com/apache/cloudstack/pull/3997#discussion_r450099761



##########
File path: 
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -4075,6 +4080,149 @@ public VlanVO doInTransaction(final TransactionStatus 
status) {
 
     }
 
+    @Override
+    public Vlan updateVlanAndPublicIpRange(UpdateVlanIpRangeCmd cmd) throws 
ConcurrentOperationException,
+            ResourceUnavailableException,ResourceAllocationException{
+
+        return  updateVlanAndPublicIpRange(cmd.getId(), 
cmd.getStartIp(),cmd.getEndIp(),
+                cmd.getGateway(),cmd.getNetmask());
+    }
+
+    @DB
+    @ActionEvent(eventType = EventTypes.EVENT_VLAN_IP_RANGE_UPDATE, 
eventDescription = "update vlan ip Range", async
+            = false)
+    public Vlan updateVlanAndPublicIpRange(final long id, String startIp,
+                                           String endIp,
+                                           String gateway,
+                                           String netmask) throws 
ConcurrentOperationException{
+
+        VlanVO vlanRange = _vlanDao.findById(id);
+        if (vlanRange == null) {
+            throw new InvalidParameterValueException("Please specify a valid 
IP range id.");
+        }
+
+        if (gateway == null) {
+            gateway = vlanRange.getVlanGateway();
+        }
+
+        if (netmask == null) {
+            netmask = vlanRange.getVlanNetmask();
+        }
+
+        final String[] existingVlanIPRangeArray = 
vlanRange.getIpRange().split("-");
+        final String currentStartIP= existingVlanIPRangeArray[0];
+        final String currentEndIP = existingVlanIPRangeArray [1];
+
+        if(startIp == null){

Review comment:
       This would more or less happen during the IP range checks down the line. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to