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; + } }