CLOUDSTACK-1862 Added vm ip address info in the list PF rules response

Signed-off-by: Abhinandan Prateek <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/9beccfdb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/9beccfdb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/9beccfdb

Branch: refs/heads/internallb
Commit: 9beccfdb5db5de75362b1cada5844f168631db81
Parents: 2dbaf8a
Author: Jayapal <[email protected]>
Authored: Wed Apr 10 12:19:06 2013 +0530
Committer: Alena Prokharchyk <[email protected]>
Committed: Wed Apr 10 15:44:04 2013 -0700

----------------------------------------------------------------------
 .../api/response/FirewallRuleResponse.java         |   12 ++++++++++++
 server/src/com/cloud/api/ApiResponseHelper.java    |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9beccfdb/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
----------------------------------------------------------------------
diff --git 
a/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java 
b/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
index 08722ae..787410a 100644
--- a/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java
@@ -71,6 +71,18 @@ public class FirewallRuleResponse extends BaseResponse {
     @SerializedName(ApiConstants.TAGS)  @Param(description="the list of 
resource tags associated with the rule", responseObject = 
ResourceTagResponse.class)
     private List<ResourceTagResponse> tags;
 
+    @SerializedName(ApiConstants.VM_GUEST_IP) @Param(description="the vm ip 
address for the port forwarding rule")
+    private String destNatVmIp;
+
+
+    public String getDestNatVmIp() {
+        return destNatVmIp;
+    }
+
+    public void setDestNatVmIp(String destNatVmIp) {
+        this.destNatVmIp = destNatVmIp;
+    }
+
 
     @Override
     public String getObjectId() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9beccfdb/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java 
b/server/src/com/cloud/api/ApiResponseHelper.java
index 724a511..993e374 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -971,6 +971,7 @@ public class ApiResponseHelper implements ResponseGenerator 
{
         response.setPublicIpAddress(ip.getAddress().addr());
 
         if (ip != null && fwRule.getDestinationIpAddress() != null) {
+            
response.setDestNatVmIp(fwRule.getDestinationIpAddress().toString());
             UserVm vm = 
ApiDBUtils.findUserVmById(fwRule.getVirtualMachineId());
             if (vm != null) {
                 response.setVirtualMachineId(vm.getUuid());

Reply via email to