mirror of https://github.com/apache/cloudstack.git
S2S VPN: Allow name to be modified in updateCustomerGateway
This commit is contained in:
parent
0f603daff6
commit
d4ce07779f
|
|
@ -40,6 +40,9 @@ public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
@Parameter(name=ApiConstants.ID, type=CommandType.LONG, required=true, description="id of customer gateway")
|
||||
private Long id;
|
||||
|
||||
@Parameter(name=ApiConstants.NAME, type=CommandType.STRING, required=false, description="name of this customer gateway")
|
||||
private String name;
|
||||
|
||||
@Parameter(name=ApiConstants.GATEWAY, type=CommandType.STRING, required=true, description="public ip address id of the customer gateway")
|
||||
private String gatewayIp;
|
||||
|
||||
|
|
@ -84,6 +87,10 @@ public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd {
|
|||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getIpsecPsk() {
|
||||
return ipsecPsk;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -363,10 +363,14 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager {
|
|||
}
|
||||
}
|
||||
}
|
||||
String name = cmd.getName();
|
||||
String gatewayIp = cmd.getGatewayIp();
|
||||
if (!NetUtils.isValidIp(gatewayIp)) {
|
||||
throw new InvalidParameterValueException("The customer gateway ip " + gatewayIp + " is invalid!", null);
|
||||
}
|
||||
if (name == null) {
|
||||
name = "VPN-" + gatewayIp;
|
||||
}
|
||||
String guestCidrList = cmd.getGuestCidrList();
|
||||
if (!NetUtils.validateGuestCidrList(guestCidrList)) {
|
||||
throw new InvalidParameterValueException("The customer gateway guest cidr list " + guestCidrList + " contains invalid guest cidr!", null);
|
||||
|
|
@ -403,6 +407,7 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager {
|
|||
dpd = false;
|
||||
}
|
||||
|
||||
gw.setName(name);
|
||||
gw.setGatewayIp(gatewayIp);
|
||||
gw.setGuestCidrList(guestCidrList);
|
||||
gw.setIkePolicy(ikePolicy);
|
||||
|
|
|
|||
Loading…
Reference in New Issue