From f5cc308e7794ea497f0ec98a9c9481b2a58017fd Mon Sep 17 00:00:00 2001 From: nit Date: Fri, 29 Apr 2011 18:39:17 +0530 Subject: [PATCH] bug 7140: Add MAC address in response list of LlistVirtualMachines API. status 7140: resolved fixed --- api/src/com/cloud/api/response/NicResponse.java | 11 +++++++++++ server/src/com/cloud/api/ApiResponseHelper.java | 1 + 2 files changed, 12 insertions(+) mode change 100644 => 100755 api/src/com/cloud/api/response/NicResponse.java diff --git a/api/src/com/cloud/api/response/NicResponse.java b/api/src/com/cloud/api/response/NicResponse.java old mode 100644 new mode 100755 index b69f0449d11..de0deda955f --- a/api/src/com/cloud/api/response/NicResponse.java +++ b/api/src/com/cloud/api/response/NicResponse.java @@ -52,6 +52,9 @@ public class NicResponse extends BaseResponse { @SerializedName("isdefault") @Param(description="true if nic is default, false otherwise") private Boolean isDefault; + @SerializedName("macaddress") @Param(description="true if nic is default, false otherwise") + private String macAddress; + public Long getId() { return id; } @@ -131,4 +134,12 @@ public class NicResponse extends BaseResponse { public void setIsDefault(Boolean isDefault) { this.isDefault = isDefault; } + + public String getMacAddress() { + return macAddress; + } + + public void setMacAddress(String macAddress) { + this.macAddress = macAddress; + } } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 10fb1580c38..a7725acbc48 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1185,6 +1185,7 @@ public class ApiResponseHelper implements ResponseGenerator { nicResponse.setGateway(singleNicProfile.getGateway()); nicResponse.setNetmask(singleNicProfile.getNetmask()); nicResponse.setNetworkid(singleNicProfile.getNetworkId()); + nicResponse.setMacAddress(singleNicProfile.getMacAddress()); if (acct.getType() == Account.ACCOUNT_TYPE_ADMIN) { if (singleNicProfile.getBroadCastUri() != null) { nicResponse.setBroadcastUri(singleNicProfile.getBroadCastUri().toString());