nvazquez commented on code in PR #6425: URL: https://github.com/apache/cloudstack/pull/6425#discussion_r901767725
########## api/src/main/java/com/cloud/network/vpc/Vpc.java: ########## @@ -95,4 +95,12 @@ public enum State { void setRollingRestart(boolean rollingRestart); Date getCreated(); + + String getDns1(); Review Comment: Can these also be unified to include Ip4? ########## server/src/main/java/com/cloud/network/NetworkServiceImpl.java: ########## @@ -557,6 +558,42 @@ private Set<Purpose> getPublicIpPurposeInRules(PublicIp ip, boolean includeRevok return result; } + private void checkNetworkDns(boolean isIpv6, NetworkOffering networkOffering, Long vpcId, + String ip4Dns1, String ip4Dns2, String ip6Dns1, String ip6Dns2) { + if (ObjectUtils.anyNotNull(ip4Dns1, ip4Dns2, ip6Dns1, ip6Dns2)) { + if (GuestType.L2.equals(networkOffering.getGuestType())) { + throw new InvalidParameterValueException(String.format("DNS can not be specified %s networks", GuestType.L2)); + } + if (vpcId != null) { + throw new InvalidParameterValueException("DNS can not be specified for a VPC tier"); + } + if (!areServicesSupportedByNetworkOffering(networkOffering.getId(), Service.Dns)) { + throw new InvalidParameterValueException("DNS can not be specified for networks with network offering that do not support DNS service"); + } + } + if (!isIpv6 && !StringUtils.isAllEmpty(ip6Dns1, ip6Dns2)) { Review Comment: Maybe also add another condition if isIpv6 and ip4Dns1 and ip4Dns2 are not empty? ########## api/src/main/java/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java: ########## @@ -95,6 +95,18 @@ public class CreateVPCCmd extends BaseAsyncCreateCmd implements UserCmd { @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the vpc to the end user or not", since = "4.4", authorized = {RoleType.Admin}) private Boolean display; + @Parameter(name = ApiConstants.DNS1, type = CommandType.STRING, description = "the first DNS for the VPC", since = "4.18.0") Review Comment: Add ipv4 on the description? Also on the parameters in the class above -- 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: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org