You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2013/12/25 00:37:24 UTC

git commit: updated refs/heads/master to 03226ba

Updated Branches:
  refs/heads/master 435aefec1 -> 03226ba53


Added deviceId parameter to the NicResponse. This information can be useful for the user if he wants to see the order of the networks in his vm


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/03226ba5
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/03226ba5
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/03226ba5

Branch: refs/heads/master
Commit: 03226ba53991c5cb3e860d0a90242a3ea47ab429
Parents: 435aefe
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Tue Dec 24 15:11:20 2013 -0800
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Tue Dec 24 15:34:43 2013 -0800

----------------------------------------------------------------------
 .../org/apache/cloudstack/api/response/NicResponse.java  | 11 +++++++++--
 server/src/com/cloud/api/ApiResponseHelper.java          |  2 ++
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03226ba5/api/src/org/apache/cloudstack/api/response/NicResponse.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/response/NicResponse.java b/api/src/org/apache/cloudstack/api/response/NicResponse.java
index 7089f88..3dd8b29 100644
--- a/api/src/org/apache/cloudstack/api/response/NicResponse.java
+++ b/api/src/org/apache/cloudstack/api/response/NicResponse.java
@@ -18,14 +18,13 @@ package org.apache.cloudstack.api.response;
 
 import java.util.List;
 
-import com.google.gson.annotations.SerializedName;
-
 import org.apache.cloudstack.api.ApiConstants;
 import org.apache.cloudstack.api.BaseResponse;
 import org.apache.cloudstack.api.EntityReference;
 
 import com.cloud.serializer.Param;
 import com.cloud.vm.Nic;
+import com.google.gson.annotations.SerializedName;
 
 @SuppressWarnings("unused")
 @EntityReference(value = Nic.class)
@@ -95,6 +94,10 @@ public class NicResponse extends BaseResponse {
     @Param(description = "the Secondary ipv4 addr of nic")
     private List<NicSecondaryIpResponse> secondaryIps;
 
+    @SerializedName(ApiConstants.DEVICE_ID)
+    @Param(description = "device id for the network when plugged into the virtual machine", since = "4.4")
+    private String deviceId;
+
     public String getId() {
         return id;
     }
@@ -159,6 +162,10 @@ public class NicResponse extends BaseResponse {
         this.ip6Address = ip6Address;
     }
 
+    public void setDeviceId(String deviceId) {
+        this.deviceId = deviceId;
+    }
+
     @Override
     public int hashCode() {
         final int prime = 31;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/03226ba5/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index d1d147f..41f254f 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -3610,6 +3610,8 @@ public class ApiResponseHelper implements ResponseGenerator {
             response.setIp6Address(result.getIp6Address());
         }
 
+        response.setDeviceId(String.valueOf(result.getDeviceId()));
+
         response.setIsDefault(result.isDefaultNic());
         return response;
     }