You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/11/27 12:33:16 UTC

[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #4503: Specify IP for VR in shared networks

Pearl1594 commented on a change in pull request #4503:
URL: https://github.com/apache/cloudstack/pull/4503#discussion_r531576198



##########
File path: engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java
##########
@@ -640,6 +640,19 @@ protected NetworkOrchestrator() {
         setStateMachine();
     }
 
+    private void updateNetworkDetails(NetworkVO networkPersisted, Network network) {
+        NetworkDetailVO networkDetailVO = null;
+        if (isNotBlank(network.getRouterIp())) {
+            networkDetailVO = new NetworkDetailVO(networkPersisted.getId(), ApiConstants.ROUTER_IP, network.getRouterIp().toString(), true);
+        }
+        if (isNotBlank(network.getRouterIpv6())) {
+            networkDetailVO = new NetworkDetailVO(networkPersisted.getId(), ApiConstants.ROUTER_IPV6, network.getRouterIpv6().toString(), true);

Review comment:
       But based on the code for persisting placeholder record, it seems like one can specify both ipv4 and ipv6 details:
   https://github.com/shapeblue/cloudstack-kddi/blob/kddi-release/server/src/com/cloud/network/router/NetworkHelperImpl.java#L701
   (and L718)

##########
File path: api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkCmdByAdmin.java
##########
@@ -42,6 +42,12 @@
     @Parameter(name=ApiConstants.HIDE_IP_ADDRESS_USAGE, type=CommandType.BOOLEAN, description="when true ip address usage for the network will not be exported by the listUsageRecords API")
     private Boolean hideIpAddressUsage;
 
+    @Parameter(name = ApiConstants.ROUTER_IP, type = CommandType.STRING, description = "IPV4 address to be assigned to a router in a shared network", since = "4.16")
+    private String routerIp;
+
+    @Parameter(name = ApiConstants.ROUTER_IPV6, type = CommandType.STRING, description = "IPV6 address to be assigned to a router in a shared network", since = "4.16")
+    private String routerIpv6;

Review comment:
       Wouldn't  adding such a validator make the field/ parameter mandatory?




----------------------------------------------------------------
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:
users@infra.apache.org