bug 6675: return snapshotId as part of the createVolume response if a non-null snapshotId was passed in. This will represent the snapshot from which the volume was created.

status 6675: resolved fixed
This commit is contained in:
Kris McQueen 2010-10-22 14:07:19 -07:00
parent e546183548
commit ecbb103016
2 changed files with 14 additions and 0 deletions

View File

@ -163,6 +163,9 @@ public class CreateVolumeCmd extends BaseAsyncCreateCmd {
if (volume.getPoolId() != null) {
response.setStoragePoolName(ApiDBUtils.findStoragePoolById(volume.getPoolId()).getName());
}
// if the volume was created from a snapshot, snapshotId will be set so we pass it back in the response
response.setSnapshotId(getSnapshotId());
response.setZoneId(volume.getDataCenterId());
response.setZoneName(ApiDBUtils.findZoneById(volume.getDataCenterId()).getName());

View File

@ -101,6 +101,9 @@ public class VolumeResponse extends BaseResponse {
@SerializedName("storage") @Param(description="name of the primary storage hosting the disk volume")
private String storagePoolName;
@SerializedName("snapshotid") @Param(description="ID of the snapshot from which this volume was created")
private Long snapshotId;
public Long getId() {
return id;
}
@ -308,4 +311,12 @@ public class VolumeResponse extends BaseResponse {
public void setStoragePoolName(String storagePoolName) {
this.storagePoolName = storagePoolName;
}
public Long getSnapshotId() {
return snapshotId;
}
public void setSnapshotId(Long snapshotId) {
this.snapshotId = snapshotId;
}
}