From d4b1831bf449b81e6b6d9d7c831b45ad43e82813 Mon Sep 17 00:00:00 2001 From: alena Date: Tue, 1 Feb 2011 14:20:21 -0800 Subject: [PATCH] Added "status" field to listPublicIpAddresses response --- .../com/cloud/api/response/IPAddressResponse.java | 12 ++++++++++++ server/src/com/cloud/api/ApiResponseHelper.java | 1 + 2 files changed, 13 insertions(+) diff --git a/api/src/com/cloud/api/response/IPAddressResponse.java b/api/src/com/cloud/api/response/IPAddressResponse.java index 7455fb4e93a..af4fb6699be 100644 --- a/api/src/com/cloud/api/response/IPAddressResponse.java +++ b/api/src/com/cloud/api/response/IPAddressResponse.java @@ -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; + } } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index cab2aad9047..06705352c88 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -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();