Skip to content

Commit 9ef4c64

Browse files
committed
address comments
1 parent 4839a2e commit 9ef4c64

File tree

53 files changed

+334
-247
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+334
-247
lines changed

api/src/main/java/com/cloud/network/element/NetworkElement.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, Reser
9292
* Release IP from the network provider if reserved
9393
* @param ipAddress
9494
*/
95-
boolean releaseIp(IpAddress ipAddress);
95+
default boolean releaseIp(IpAddress ipAddress) {
96+
return true;
97+
}
9698

9799
/**
98100
* The network is being shutdown.

api/src/main/java/com/cloud/network/element/VpcProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,5 @@ boolean implementVpc(Vpc vpc, DeployDestination dest, ReservationContext context
5656

5757
boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address);
5858

59-
boolean updateVpc(Vpc vpc, String previousVpcName);
59+
default boolean updateVpc(Vpc vpc, String previousVpcName) { return true; }
6060
}

api/src/main/java/com/cloud/network/netris/NetrisService.java

Lines changed: 243 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,44 +24,287 @@
2424

2525
import java.util.List;
2626

27+
/**
28+
* Interface for Netris Services that provides methods to manage VPCs, networks,
29+
* NAT rules, network rules, and static routes in an SDN (Software Defined Networking) environment.
30+
*/
31+
2732
public interface NetrisService {
33+
34+
/**
35+
* Creates IPAM (IP Address Management) allocations for zone-level public ranges.
36+
*
37+
* @param zoneId the ID of the zone
38+
* @return true if the operation is successful, false otherwise
39+
*/
2840
boolean createIPAMAllocationsForZoneLevelPublicRanges(long zoneId);
2941

42+
/**
43+
* Creates a VPC (Virtual Private Cloud) resource.
44+
*
45+
* @param zoneId the ID of the zone
46+
* @param accountId the ID of the account
47+
* @param domainId the ID of the domain
48+
* @param vpcId the ID of the VPC
49+
* @param vpcName the name of the VPC
50+
* @param sourceNatEnabled true if source NAT is enabled
51+
* @param cidr the CIDR of the VPC
52+
* @param isVpcNetwork true if it is a VPC network
53+
* @return true if the operation is successful, false otherwise
54+
*/
3055
boolean createVpcResource(long zoneId, long accountId, long domainId, Long vpcId, String vpcName, boolean sourceNatEnabled, String cidr, boolean isVpcNetwork);
3156

57+
/**
58+
* Updates an existing VPC resource.
59+
*
60+
* @param zoneId the ID of the zone
61+
* @param accountId the ID of the account
62+
* @param domainId the ID of the domain
63+
* @param vpcId the ID of the VPC
64+
* @param vpcName the new name of the VPC
65+
* @param previousVpcName the previous name of the VPC
66+
* @return true if the operation is successful, false otherwise
67+
*/
3268
boolean updateVpcResource(long zoneId, long accountId, long domainId, Long vpcId, String vpcName, String previousVpcName);
3369

70+
/**
71+
* Deletes a VPC resource.
72+
*
73+
* @param zoneId the ID of the zone
74+
* @param accountId the ID of the account
75+
* @param domainId the ID of the domain
76+
* @param vpc the VPC to delete
77+
* @return true if the operation is successful, false otherwise
78+
*/
3479
boolean deleteVpcResource(long zoneId, long accountId, long domainId, Vpc vpc);
3580

81+
/**
82+
* Creates a virtual network (vNet) resource.
83+
*
84+
* @param zoneId the ID of the zone
85+
* @param accountId the ID of the account
86+
* @param domainId the ID of the domain
87+
* @param vpcName the name of the VPC
88+
* @param vpcId the ID of the VPC
89+
* @param networkName the name of the network
90+
* @param networkId the ID of the network
91+
* @param cidr the CIDR of the network
92+
* @param globalRouting true if global routing is enabled
93+
* @return true if the operation is successful, false otherwise
94+
*/
3695
boolean createVnetResource(Long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, String cidr, Boolean globalRouting);
3796

97+
/**
98+
* Updates an existing vNet resource.
99+
*
100+
* @param zoneId the ID of the zone
101+
* @param accountId the ID of the account
102+
* @param domainId the ID of the domain
103+
* @param vpcName the name of the VPC
104+
* @param vpcId the ID of the VPC
105+
* @param networkName the new name of the network
106+
* @param networkId the ID of the network
107+
* @param prevNetworkName the previous name of the network
108+
* @return true if the operation is successful, false otherwise
109+
*/
38110
boolean updateVnetResource(Long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, String prevNetworkName);
39111

112+
/**
113+
* Deletes an existing vNet resource.
114+
*
115+
* @param zoneId the ID of the zone
116+
* @param accountId the ID of the account
117+
* @param domainId the ID of the domain
118+
* @param vpcName the name of the VPC
119+
* @param vpcId the ID of the VPC
120+
* @param networkName the name of the network
121+
* @param networkId the ID of the network
122+
* @param cidr the CIDR of the network
123+
* @return true if the operation is successful, false otherwise
124+
*/
40125
boolean deleteVnetResource(long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, String cidr);
41126

127+
/**
128+
* Creates a source NAT rule for a VPC or network.
129+
*
130+
* @param zoneId the ID of the zone
131+
* @param accountId the ID of the account
132+
* @param domainId the ID of the domain
133+
* @param vpcName the name of the VPC
134+
* @param vpcId the ID of the VPC
135+
* @param networkName the name of the network
136+
* @param networkId the ID of the network
137+
* @param isForVpc true if the rule applies to a VPC
138+
* @param vpcCidr the VPC CIDR
139+
* @param sourceNatIp the source NAT IP
140+
* @return true if the operation is successful, false otherwise
141+
*/
42142
boolean createSnatRule(long zoneId, long accountId, long domainId, String vpcName, long vpcId, String networkName, long networkId, boolean isForVpc, String vpcCidr, String sourceNatIp);
43143

144+
/**
145+
* Creates a port forwarding rule for a VPC or network.
146+
*
147+
* @param zoneId the ID of the zone
148+
* @param accountId the ID of the account
149+
* @param domainId the ID of the domain
150+
* @param vpcName the name of the VPC
151+
* @param vpcId the ID of the VPC
152+
* @param networkName the name of the network
153+
* @param networkId the ID of the network
154+
* @param isForVpc true if the rule applies to a VPC
155+
* @param vpcCidr the VPC CIDR
156+
* @param networkRule the network rule to forward
157+
* @return true if the operation is successful, false otherwise
158+
*/
44159
boolean createPortForwardingRule(long zoneId, long accountId, long domainId, String vpcName, long vpcId, String networkName, Long networkId, boolean isForVpc, String vpcCidr, SDNProviderNetworkRule networkRule);
45160

161+
/**
162+
* Deletes a port forwarding rule for a VPC or network.
163+
*
164+
* @param zoneId the ID of the zone
165+
* @param accountId the ID of the account
166+
* @param domainId the ID of the domain
167+
* @param vpcName the name of the VPC
168+
* @param vpcId the ID of the VPC
169+
* @param networkName the name of the network
170+
* @param networkId the ID of the network
171+
* @param isForVpc true if the rule applies to a VPC
172+
* @param vpcCidr the VPC CIDR
173+
* @param networkRule the network rule to remove
174+
* @return true if the operation is successful, false otherwise
175+
*/
46176
boolean deletePortForwardingRule(long zoneId, long accountId, long domainId, String vpcName, Long vpcId, String networkName, Long networkId, boolean isForVpc, String vpcCidr, SDNProviderNetworkRule networkRule);
47177

178+
/**
179+
* Updates the source NAT IP for a specified VPC.
180+
*
181+
* @param vpc the VPC to updates
182+
* @param address the new source NAT IP address
183+
* @return true if the operation is successful, false otherwise
184+
*/
48185
boolean updateVpcSourceNatIp(Vpc vpc, IpAddress address);
49186

187+
/**
188+
* Creates a static NAT rule for a specific VM.
189+
*
190+
* @param zoneId the ID of the zone
191+
* @param accountId the ID of the account
192+
* @param domainId the ID of the domain
193+
* @param networkResourceName the name of the network resource
194+
* @param networkResourceId the ID of the network resource
195+
* @param isForVpc true if the rule applies to a VPC
196+
* @param vpcCidr the VPC CIDR
197+
* @param staticNatIp the static NAT IP
198+
* @param vmIp the VM's IP address
199+
* @param vmId the ID of the VM
200+
* @return true if the operation is successful, false otherwise
201+
*/
50202
boolean createStaticNatRule(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String vpcCidr, String staticNatIp, String vmIp, long vmId);
51203

204+
/**
205+
* Deletes a static NAT rule for a specific VM.
206+
*
207+
* @param zoneId the ID of the zone
208+
* @param accountId the ID of the account
209+
* @param domainId the ID of the domain
210+
* @param networkResourceName the name of the network resource
211+
* @param networkResourceId the ID of the network resource
212+
* @param isForVpc true if the rule applies to a VPC
213+
* @param staticNatIp the static NAT IP
214+
* @param vmId the ID of the VM
215+
* @return true if the operation is successful, false otherwise
216+
*/
52217
boolean deleteStaticNatRule(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String staticNatIp, long vmId);
53218

219+
/**
220+
* Adds firewall rules to a specific network.
221+
*
222+
* @param network the target network
223+
* @param firewallRules the list of firewall rules to add
224+
* @return true if the operation is successful, false otherwise
225+
*/
54226
boolean addFirewallRules(Network network, List<NetrisNetworkRule> firewallRules);
227+
228+
/**
229+
* Deletes firewall rules from a specific network.
230+
*
231+
* @param network the target network
232+
* @param firewallRules the list of firewall rules to delete
233+
* @return true if the operation is successful, false otherwise
234+
*/
55235
boolean deleteFirewallRules(Network network, List<NetrisNetworkRule> firewallRules);
56236

237+
/**
238+
* Adds or updates a static route for a specific network or VPC.
239+
*
240+
* @param zoneId the ID of the zone
241+
* @param accountId the ID of the account
242+
* @param domainId the ID of the domain
243+
* @param networkResourceName the name of the network resource
244+
* @param networkResourceId the ID of the network resource
245+
* @param isForVpc true if it is for a VPC
246+
* @param prefix the IP prefix of the route
247+
* @param nextHop the next hop address
248+
* @param routeId the ID of the route
249+
* @param updateRoute true if the route should be updated
250+
* @return true if the operation is successful, false otherwise
251+
*/
57252
boolean addOrUpdateStaticRoute(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String prefix, String nextHop, Long routeId, boolean updateRoute);
58253

254+
/**
255+
* Deletes a specific static route for a network or VPC.
256+
*
257+
* @param zoneId the ID of the zone
258+
* @param accountId the ID of the account
259+
* @param domainId the ID of the domain
260+
* @param networkResourceName the name of the network resource
261+
* @param networkResourceId the ID of the network resource
262+
* @param isForVpc true if it is for a VPC
263+
* @param prefix the IP prefix of the route
264+
* @param nextHop the next hop address
265+
* @param routeId the ID of the route
266+
* @return true if the operation is successful, false otherwise
267+
*/
59268
boolean deleteStaticRoute(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String prefix, String nextHop, Long routeId);
60269

270+
/**
271+
* Lists static routes for a specific network or VPC.
272+
*
273+
* @param zoneId the ID of the zone
274+
* @param accountId the ID of the account
275+
* @param domainId the ID of the domain
276+
* @param networkResourceName the name of the network resource
277+
* @param networkResourceId the ID of the network resource
278+
* @param isForVpc true if it is for a VPC
279+
* @param prefix the IP prefix of the route
280+
* @param nextHop the next hop address
281+
* @param routeId the ID of the route
282+
* @return a list of static routes
283+
*/
61284
List<StaticRoute> listStaticRoutes(long zoneId, long accountId, long domainId, String networkResourceName, Long networkResourceId, boolean isForVpc, String prefix, String nextHop, Long routeId);
62285

286+
/**
287+
* Releases a NAT IP address.
288+
*
289+
* @param zoneId the ID of the zone
290+
* @param publicIp the public NAT IP to release
291+
* @return true if the operation is successful, false otherwise
292+
*/
63293
boolean releaseNatIp(long zoneId, String publicIp);
64294

295+
/**
296+
* Creates or updates a load balancer (LB) rule.
297+
*
298+
* @param rule the network rule for the load balancer
299+
* @return true if the operation is successful, false otherwise
300+
*/
65301
boolean createOrUpdateLbRule(NetrisNetworkRule rule);
302+
303+
/**
304+
* Deletes a load balancer (LB) rule.
305+
*
306+
* @param rule the network rule to delete
307+
* @return true if the operation is successful, false otherwise
308+
*/
66309
boolean deleteLbRule(NetrisNetworkRule rule);
67310
}

api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public class CreateNetworkOfferingCmd extends BaseCmd {
151151
@Parameter(name = ApiConstants.PROVIDER,
152152
type = CommandType.STRING,
153153
description = "Name of the provider providing the service",
154-
since = "4.20.0")
154+
since = "4.21.0")
155155
private String provider;
156156

157157
@Parameter(name = ApiConstants.NSX_SUPPORT_LB,

api/src/main/java/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class CreateVlanIpRangeCmd extends BaseCmd {
115115
@Parameter(name = ApiConstants.FOR_SYSTEM_VMS, type = CommandType.BOOLEAN, description = "true if IP range is set to system vms, false if not")
116116
private Boolean forSystemVms;
117117

118-
@Parameter(name = ApiConstants.PROVIDER, type = CommandType.STRING, description = "Provider name for which the IP range is reserved for", since = "4.20.0")
118+
@Parameter(name = ApiConstants.PROVIDER, type = CommandType.STRING, description = "Provider name for which the IP range is reserved for", since = "4.21.0")
119119
private String provider;
120120

121121
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
126126
@Parameter(name = ApiConstants.PROVIDER,
127127
type = CommandType.STRING,
128128
description = "Name of the provider providing the service",
129-
since = "4.20.0")
129+
since = "4.21.0")
130130
private String provider;
131131

132132
@Parameter(name = ApiConstants.NSX_SUPPORT_LB,

api/src/main/java/org/apache/cloudstack/api/command/user/address/ListPublicIpAddressesCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public class ListPublicIpAddressesCmd extends BaseListRetrieveOnlyResourceCountC
108108
@Parameter(name = ApiConstants.FOR_SYSTEM_VMS, type = CommandType.BOOLEAN, description = "true if range is dedicated for system VMs", since = "4.20.0")
109109
private Boolean forSystemVMs;
110110

111-
@Parameter(name = ApiConstants.FOR_PROVIDER, type = CommandType.BOOLEAN, description = "true if range is dedicated for external network provider", since = "4.20.0")
111+
@Parameter(name = ApiConstants.FOR_PROVIDER, type = CommandType.BOOLEAN, description = "true if range is dedicated for external network provider", since = "4.21.0")
112112
private Boolean forProvider;
113113

114114
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public class CreateStaticRouteCmd extends BaseAsyncCreateCmd {
5757

5858
@Parameter(name = ApiConstants.NEXT_HOP,
5959
type = CommandType.STRING,
60-
description = "the next hop of static route. Mutually exclusive with the gatewayid parameter")
60+
description = "the next hop of static route. Mutually exclusive with the gatewayid parameter",
61+
since = "4.21.0")
6162
private String nextHop;
6263

6364
@Parameter(name = ApiConstants.CIDR, required = true, type = CommandType.STRING, description = "static route cidr")

api/src/main/java/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ public class CreateVpnGatewayCmd extends BaseAsyncCreateCmd {
5151
@Parameter(name = ApiConstants.IP_ADDRESS_ID,
5252
type = CommandType.UUID,
5353
entityType = IPAddressResponse.class,
54-
description = "the public IP address ID for which VPN gateway is being enabled. By default the source NAT IP or router IP will be used.")
54+
description = "the public IP address ID for which VPN gateway is being enabled. By default the source NAT IP or router IP will be used.",
55+
since = "4.21.0")
5556
private Long ipAddressId;
5657

5758
@Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "an optional field, whether to the display the vpn to the end user or not", since = "4.4", authorized = {RoleType.Admin})

api/src/main/java/org/apache/cloudstack/api/response/IPAddressResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public class IPAddressResponse extends BaseResponseWithAnnotations implements Co
176176
private boolean forSystemVms;
177177

178178
@SerializedName(ApiConstants.FOR_PROVIDER)
179-
@Param(description="true if range is dedicated for external network providers")
179+
@Param(description="true if range is dedicated for external network providers", since = "4.21.0")
180180
private boolean forProvider;
181181

182182
public void setIpAddress(String ipAddress) {

0 commit comments

Comments
 (0)