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

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Jayapal 2013-04-10 12:19:06 +05:30 committed by Abhinandan Prateek
parent cbbba28657
commit c8f2003138
2 changed files with 13 additions and 0 deletions

View File

@ -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() {

View File

@ -965,6 +965,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());