@@ -716,6 +716,7 @@ public boolean createVnet(CreateNetrisVnetCommand cmd) {
716716 String netrisGateway = cmd .getGateway () + "/" + netmask ;
717717 String netrisV6Cidr = cmd .getIpv6Cidr ();
718718 boolean isVpc = cmd .isVpc ();
719+ Boolean isGlobalRouting = cmd .isGlobalRouting ();
719720
720721 String netrisVpcName = getNetrisVpcName (cmd , vpcId , vpcName );
721722 VPCListing associatedVpc = getNetrisVpcResource (netrisVpcName );
@@ -733,15 +734,15 @@ public boolean createVnet(CreateNetrisVnetCommand cmd) {
733734 String netrisVnetName = NetrisResourceObjectUtils .retrieveNetrisResourceObjectName (cmd , NetrisResourceObjectUtils .NetrisObjectType .VNET , vNetName ) ;
734735 String netrisSubnetName = NetrisResourceObjectUtils .retrieveNetrisResourceObjectName (cmd , NetrisResourceObjectUtils .NetrisObjectType .IPAM_SUBNET , vnetCidr ) ;
735736
736- createIpamSubnetInternal (netrisSubnetName , vnetCidr , SubnetBody .PurposeEnum .COMMON , associatedVpc );
737+ createIpamSubnetInternal (netrisSubnetName , vnetCidr , SubnetBody .PurposeEnum .COMMON , associatedVpc , isGlobalRouting );
737738 if (Objects .nonNull (netrisV6Cidr )) {
738739 String netrisV6IpamAllocationName = NetrisResourceObjectUtils .retrieveNetrisResourceObjectName (cmd , NetrisResourceObjectUtils .NetrisObjectType .IPAM_ALLOCATION , netrisV6Cidr );
739740 String netrisV6SubnetName = NetrisResourceObjectUtils .retrieveNetrisResourceObjectName (cmd , NetrisResourceObjectUtils .NetrisObjectType .IPAM_SUBNET , netrisV6Cidr ) ;
740741 InlineResponse2004Data createdIpamAllocation = createIpamAllocationInternal (netrisV6IpamAllocationName , netrisV6Cidr , associatedVpc );
741742 if (Objects .isNull (createdIpamAllocation )) {
742743 throw new CloudRuntimeException (String .format ("Failed to create Netris IPAM Allocation %s for VPC %s" , netrisV6IpamAllocationName , netrisVpcName ));
743744 }
744- createIpamSubnetInternal (netrisV6SubnetName , netrisV6Cidr , SubnetBody .PurposeEnum .COMMON , associatedVpc );
745+ createIpamSubnetInternal (netrisV6SubnetName , netrisV6Cidr , SubnetBody .PurposeEnum .COMMON , associatedVpc , isGlobalRouting );
745746 }
746747 logger .debug ("Successfully created IPAM Subnet {} for network {} on Netris" , netrisSubnetName , networkName );
747748
@@ -851,7 +852,7 @@ public boolean setupZoneLevelPublicRange(SetupNetrisPublicRangeCommand cmd) {
851852 IpTreeSubnet exactSubnet = getIpamSubnetByAllocationAndPrefixAndPurposeAndVpc (ipamAllocationId , exactCidr , IpTreeSubnet .PurposeEnum .COMMON , systemVpc );
852853 if (exactSubnet == null ) {
853854 String ipamSubnetName = NetrisResourceObjectUtils .retrieveNetrisResourceObjectName (cmd , NetrisResourceObjectUtils .NetrisObjectType .IPAM_SUBNET , exactCidr );
854- createIpamSubnetInternal (ipamSubnetName , exactCidr , SubnetBody .PurposeEnum .COMMON , systemVpc );
855+ createIpamSubnetInternal (ipamSubnetName , exactCidr , SubnetBody .PurposeEnum .COMMON , systemVpc , null );
855856 }
856857 } catch (ApiException e ) {
857858 String msg = String .format ("Error setting up the Netris Public Range %s on super CIDR %s" , exactCidr , superCidr );
@@ -1000,7 +1001,7 @@ private void createNatSubnet(String natIp, Integer netrisVpcId) {
10001001 List <IpTreeSubnet > matchedSubnets = getSubnet (vpcFilter , netrisSubnetName );
10011002 if (matchedSubnets .isEmpty ()) {
10021003 VPCListing systemVpc = getSystemVpc ();
1003- createIpamSubnetInternal (natIp , natIp , SubnetBody .PurposeEnum .NAT , systemVpc );
1004+ createIpamSubnetInternal (natIp , natIp , SubnetBody .PurposeEnum .NAT , systemVpc , null );
10041005 return ;
10051006 }
10061007 logger .debug ("NAT subnet: {} already exists" , natIp );
@@ -1191,7 +1192,7 @@ private void deleteSubnetInternal(FilterByVpc vpcFilter, String netrisVnetName,
11911192 }
11921193 }
11931194
1194- private InlineResponse2004Data createIpamSubnetInternal (String subnetName , String subnetPrefix , SubnetBody .PurposeEnum purpose , VPCListing vpc ) {
1195+ private InlineResponse2004Data createIpamSubnetInternal (String subnetName , String subnetPrefix , SubnetBody .PurposeEnum purpose , VPCListing vpc , Boolean isGlobalRouting ) {
11951196 logger .debug ("Creating Netris IPAM Subnet {} for VPC {}" , subnetPrefix , vpc .getName ());
11961197 try {
11971198
@@ -1215,6 +1216,9 @@ private InlineResponse2004Data createIpamSubnetInternal(String subnetName, Strin
12151216
12161217 subnetBody .setPurpose (purpose );
12171218 subnetBody .setPrefix (subnetPrefix );
1219+ if (isGlobalRouting != null ) {
1220+ subnetBody .setGlobalRouting (isGlobalRouting );
1221+ }
12181222 IpamApi ipamApi = apiClient .getApiStubForMethod (IpamApi .class );
12191223 InlineResponse2004 subnetResponse = ipamApi .apiV2IpamSubnetPost (subnetBody );
12201224 if (subnetResponse == null || !subnetResponse .isIsSuccess ()) {
0 commit comments