From 768be1a69b24e86a499b19eec4df3af64101c2bb Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Mon, 30 Jul 2012 15:45:48 -0700 Subject: [PATCH] S2S VPN: CS-15724: Show more parameter for listVpnCustomerGateways API --- .../Site2SiteCustomerGatewayResponse.java | 21 +++++++++++++++++++ .../network/Site2SiteCustomerGateway.java | 3 +++ .../src/com/cloud/api/ApiResponseHelper.java | 4 ++++ .../network/Site2SiteCustomerGatewayVO.java | 5 ++++- 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java b/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java index b0a90c9d81e..0b5d286dce6 100644 --- a/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java +++ b/api/src/com/cloud/api/response/Site2SiteCustomerGatewayResponse.java @@ -39,6 +39,15 @@ public class Site2SiteCustomerGatewayResponse extends BaseResponse implements Co @SerializedName(ApiConstants.IPSEC_PSK) @Param(description="IPsec preshared-key of customer gateway") private String ipsecPsk; + @SerializedName(ApiConstants.IKE_POLICY) @Param(description="IKE policy of customer gateway") + private String ikePolicy; + + @SerializedName(ApiConstants.ESP_POLICY) @Param(description="IPsec policy of customer gateway") + private String espPolicy; + + @SerializedName(ApiConstants.LIFETIME) @Param(description="Lifetime of IKE and IPsec policy of customer gateway") + private Long lifetime; + @SerializedName(ApiConstants.ACCOUNT) @Param(description="the owner") private String accountName; @@ -81,6 +90,18 @@ public class Site2SiteCustomerGatewayResponse extends BaseResponse implements Co this.ipsecPsk = ipsecPsk; } + public void setIkePolicy(String ikePolicy) { + this.ikePolicy = ikePolicy; + } + + public void setEspPolicy(String espPolicy) { + this.espPolicy = espPolicy; + } + + public void setLifetime(Long lifetime) { + this.lifetime = lifetime; + } + public void setRemoved(Date removed) { this.removed = removed; } diff --git a/api/src/com/cloud/network/Site2SiteCustomerGateway.java b/api/src/com/cloud/network/Site2SiteCustomerGateway.java index d4facc34e75..29f580f18ba 100644 --- a/api/src/com/cloud/network/Site2SiteCustomerGateway.java +++ b/api/src/com/cloud/network/Site2SiteCustomerGateway.java @@ -9,6 +9,9 @@ public interface Site2SiteCustomerGateway extends ControlledEntity { public String getGatewayIp(); public String getGuestCidrList(); public String getIpsecPsk(); + public String getIkePolicy(); + public String getEspPolicy(); + public Long getLifetime(); public Date getRemoved(); String getName(); } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 1e4f82626fd..61edccbbb79 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3915,6 +3915,10 @@ public class ApiResponseHelper implements ResponseGenerator { response.setGatewayIp(result.getGatewayIp()); response.setGuestCidrList(result.getGuestCidrList()); response.setIpsecPsk(result.getIpsecPsk()); + response.setIkePolicy(result.getIkePolicy()); + response.setEspPolicy(result.getEspPolicy()); + response.setLifetime(result.getLifetime()); + response.setRemoved(result.getRemoved()); response.setObjectName("vpncustomergateway"); diff --git a/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java b/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java index 5063f780b30..573d5f1445b 100644 --- a/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java +++ b/server/src/com/cloud/network/Site2SiteCustomerGatewayVO.java @@ -118,7 +118,8 @@ public class Site2SiteCustomerGatewayVO implements Site2SiteCustomerGateway { this.removed = removed; } - public long getLifetime() { + @Override + public Long getLifetime() { return lifetime; } @@ -126,6 +127,7 @@ public class Site2SiteCustomerGatewayVO implements Site2SiteCustomerGateway { this.lifetime = lifetime; } + @Override public String getIkePolicy() { return ikePolicy; } @@ -134,6 +136,7 @@ public class Site2SiteCustomerGatewayVO implements Site2SiteCustomerGateway { this.ikePolicy = ikePolicy; } + @Override public String getEspPolicy() { return espPolicy; }