weizhouapache commented on a change in pull request #5769:
URL: https://github.com/apache/cloudstack/pull/5769#discussion_r778671162
##########
File path: server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java
##########
@@ -1833,8 +1860,63 @@ public PrivateGateway createVpcPrivateGateway(final long
vpcId, Long physicalNet
throw ex;
}
+ // Validate vlanId and associatedNetworkId
+ if (broadcastUri == null && associatedNetworkId == null) {
+ throw new InvalidParameterValueException("One of vlanId and
associatedNetworkId must be specified");
+ }
+ if (broadcastUri != null && associatedNetworkId != null) {
+ throw new InvalidParameterValueException("vlanId and
associatedNetworkId are mutually exclusive");
+ }
+
+ // Validate network offering
+ NetworkOfferingVO ntwkOff = null;
+ if (networkOfferingIdPassed != null) {
+ ntwkOff = _networkOfferingDao.findById(networkOfferingIdPassed);
+ if (ntwkOff == null) {
+ throw new InvalidParameterValueException("Unable to find
network offering by id specified");
+ }
+ if (! TrafficType.Guest.equals(ntwkOff.getTrafficType())) {
+ throw new InvalidParameterValueException("The network offering
cannot be used to create Guest network");
+ }
+ if (! GuestType.Isolated.equals(ntwkOff.getGuestType())) {
+ throw new InvalidParameterValueException("The network offering
cannot be used to create Isolated network");
+ }
+ } else if (broadcastUri != null) {
+ ntwkOff =
_networkOfferingDao.findByUniqueName(NetworkOffering.SystemPrivateGatewayNetworkOffering);
+ } else {
+ ntwkOff =
_networkOfferingDao.findByUniqueName(NetworkOffering.SystemPrivateGatewayNetworkOfferingWithoutVlan);
+ }
Review comment:
will do
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]