Skip to content

Commit c8f2003

Browse files
JayapalUradiAbhinandan Prateek
authored andcommitted
CLOUDSTACK-1862 Added vm ip address info in the list PF rules response
Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
1 parent cbbba28 commit c8f2003

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

‎api/src/org/apache/cloudstack/api/response/FirewallRuleResponse.java‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ public class FirewallRuleResponse extends BaseResponse {
7171
@SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with the rule", responseObject = ResourceTagResponse.class)
7272
private List<ResourceTagResponse> tags;
7373

74+
@SerializedName(ApiConstants.VM_GUEST_IP) @Param(description="the vm ip address for the port forwarding rule")
75+
private String destNatVmIp;
76+
77+
78+
public String getDestNatVmIp() {
79+
return destNatVmIp;
80+
}
81+
82+
public void setDestNatVmIp(String destNatVmIp) {
83+
this.destNatVmIp = destNatVmIp;
84+
}
85+
7486

7587
@Override
7688
public String getObjectId() {

‎server/src/com/cloud/api/ApiResponseHelper.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ public FirewallRuleResponse createPortForwardingRuleResponse(PortForwardingRule
965965
response.setPublicIpAddress(ip.getAddress().addr());
966966

967967
if (ip != null && fwRule.getDestinationIpAddress() != null) {
968+
response.setDestNatVmIp(fwRule.getDestinationIpAddress().toString());
968969
UserVm vm = ApiDBUtils.findUserVmById(fwRule.getVirtualMachineId());
969970
if (vm != null) {
970971
response.setVirtualMachineId(vm.getUuid());

0 commit comments

Comments
 (0)