CLOUDSTACK-2934 Fixed not showing uuid in list firewall rules response

Signed-off-by: Abhinandan Prateek <aprateek@apache.org>
This commit is contained in:
Jayapal 2013-06-11 20:01:23 +05:30 committed by Abhinandan Prateek
parent aeb024723a
commit b72c79b370
2 changed files with 7 additions and 6 deletions

View File

@ -39,10 +39,10 @@ public class FirewallResponse extends BaseResponse {
private String endPort;
@SerializedName(ApiConstants.IP_ADDRESS_ID) @Param(description="the public ip address id for the firewall rule")
private Long publicIpAddressId;
private String publicIpAddressId;
@SerializedName(ApiConstants.NETWORK_ID) @Param(description="the network id of the firewall rule")
private Long networkId;
private String networkId;
@SerializedName(ApiConstants.IP_ADDRESS) @Param(description="the public ip address for the firewall rule")
private String publicIpAddress;
@ -78,7 +78,7 @@ public class FirewallResponse extends BaseResponse {
this.endPort = endPort;
}
public void setPublicIpAddressId(Long publicIpAddressId) {
public void setPublicIpAddressId(String publicIpAddressId) {
this.publicIpAddressId = publicIpAddressId;
}
@ -86,7 +86,7 @@ public class FirewallResponse extends BaseResponse {
this.publicIpAddress = publicIpAddress;
}
public void setNetworkId(Long networkId) {
public void setNetworkId(String networkId) {
this.networkId = networkId;
}

View File

@ -2399,11 +2399,12 @@ public class ApiResponseHelper implements ResponseGenerator {
if (fwRule.getTrafficType() == FirewallRule.TrafficType.Ingress) {
IpAddress ip = ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId());
response.setPublicIpAddressId(ip.getId());
response.setPublicIpAddressId(ip.getUuid());
response.setPublicIpAddress(ip.getAddress().addr());
} else if (fwRule.getTrafficType() == FirewallRule.TrafficType.Egress) {
response.setPublicIpAddress(null);
response.setNetworkId(fwRule.getNetworkId());
Network network = ApiDBUtils.findNetworkById(fwRule.getNetworkId());
response.setNetworkId(network.getUuid());
}
FirewallRule.State state = fwRule.getState();