mirror of https://github.com/apache/cloudstack.git
returning the public ip address in the creation of firewall rule, for the UI to consume
This commit is contained in:
parent
aca45d68d3
commit
c4f1b35aef
|
|
@ -1002,6 +1002,7 @@ public class ApiResponseHelper {
|
|||
response.setPrivatePort(fwRule.getPrivatePort());
|
||||
response.setProtocol(fwRule.getProtocol());
|
||||
response.setPublicPort(fwRule.getPublicPort());
|
||||
response.setPublicIpAddress(fwRule.getPublicIpAddress());
|
||||
if (fwRule.getPublicIpAddress() != null && fwRule.getPrivateIpAddress() != null) {
|
||||
UserVm vm = ApiDBUtils.findUserVmByPublicIpAndGuestIp(fwRule.getPublicIpAddress(), fwRule.getPrivateIpAddress());
|
||||
response.setVirtualMachineId(vm.getId());
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ public class FirewallRuleResponse extends BaseResponse {
|
|||
@SerializedName("vmdisplayname") @Param(description="the VM display name for the port forwarding rule")
|
||||
private String virtualMachineDisplayName;
|
||||
|
||||
@SerializedName("publicipaddress") @Param(description="the public ip address for the port forwarding rule")
|
||||
private String publicIpAddress;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
@ -98,4 +101,12 @@ public class FirewallRuleResponse extends BaseResponse {
|
|||
public void setVirtualMachineDisplayName(String virtualMachineDisplayName) {
|
||||
this.virtualMachineDisplayName = virtualMachineDisplayName;
|
||||
}
|
||||
|
||||
public String getPublicIpAddress() {
|
||||
return publicIpAddress;
|
||||
}
|
||||
|
||||
public void setPublicIpAddress(String publicIpAddress) {
|
||||
this.publicIpAddress = publicIpAddress;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue