From a5dd8a5bc7e8c34c2e2e0f490e35698a05ba9349 Mon Sep 17 00:00:00 2001 From: Kris McQueen Date: Fri, 22 Oct 2010 16:53:49 -0700 Subject: [PATCH] bug 6684: return 'attached' parameter as part of listVolumes response. For the diskOffering information looking like service offering information, this is because the diskOffering on the root volume is set to be the service offering of the VM. If this is a change from 2.1.x please re-open this bug, but for the time being I'm going to assume this is working as expected. status 6684: resolved fixed --- server/src/com/cloud/api/commands/ListVolumesCmd.java | 1 + server/src/com/cloud/api/response/VolumeResponse.java | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/server/src/com/cloud/api/commands/ListVolumesCmd.java b/server/src/com/cloud/api/commands/ListVolumesCmd.java index 12f6bbb2493..44f55c1c21f 100755 --- a/server/src/com/cloud/api/commands/ListVolumesCmd.java +++ b/server/src/com/cloud/api/commands/ListVolumesCmd.java @@ -206,6 +206,7 @@ public class ListVolumesCmd extends BaseListCmd { volResponse.setSourceType(volume.getSourceType().toString()); } volResponse.setHypervisor(ApiDBUtils.getVolumeHyperType(volume.getId()).toString()); + volResponse.setAttached(volume.getAttached()); volResponse.setResponseName("volume"); volResponses.add(volResponse); diff --git a/server/src/com/cloud/api/response/VolumeResponse.java b/server/src/com/cloud/api/response/VolumeResponse.java index 8d5b643da63..36ffd97513a 100644 --- a/server/src/com/cloud/api/response/VolumeResponse.java +++ b/server/src/com/cloud/api/response/VolumeResponse.java @@ -104,6 +104,9 @@ public class VolumeResponse extends BaseResponse { @SerializedName("snapshotid") @Param(description="ID of the snapshot from which this volume was created") private Long snapshotId; + @SerializedName("attached") @Param(description="the date the volume was attached to a VM instance") + private Date attached; + public Long getId() { return id; } @@ -319,4 +322,12 @@ public class VolumeResponse extends BaseResponse { public void setSnapshotId(Long snapshotId) { this.snapshotId = snapshotId; } + + public Date getAttached() { + return attached; + } + + public void setAttached(Date attached) { + this.attached = attached; + } }