Added "status" field to listPublicIpAddresses response

This commit is contained in:
alena 2011-02-01 14:20:21 -08:00
parent 668fde991c
commit d4b1831bf4
2 changed files with 13 additions and 0 deletions

View File

@ -19,6 +19,7 @@ package com.cloud.api.response;
import java.util.Date;
import com.cloud.api.ApiConstants;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
@ -77,6 +78,9 @@ public class IPAddressResponse extends BaseResponse {
@SerializedName("networkid") @Param(description="the ID of the Network where ip belongs to")
private Long networkId;
@SerializedName(ApiConstants.STATE) @Param(description="State of the ip address. Can be: Allocatin, Allocated and Releasing")
private String state;
public String getIpAddress() {
return ipAddress;
}
@ -220,4 +224,12 @@ public class IPAddressResponse extends BaseResponse {
public void setId(Long id) {
this.id = id;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}

View File

@ -658,6 +658,7 @@ public class ApiResponseHelper implements ResponseGenerator {
}
ipResponse.setNetworkId(networkId);
ipResponse.setState(ipAddress.getState().toString());
// show this info to admin only
Account account = UserContext.current().getCaller();