CLOUDSTACK-9915 ListSnapshots API does not provide virtual size information of the snapshots (#2101)

This commit is contained in:
vedulasantosh 2017-08-24 16:51:13 +05:30 committed by Rohit Yadav
parent 57255ac72c
commit 4b38d36284
3 changed files with 10 additions and 0 deletions

View File

@ -653,6 +653,7 @@ public class ApiConstants {
public static final String OVM3_CLUSTER = "ovm3cluster";
public static final String OVM3_VIP = "ovm3vip";
public static final String CLEAN_UP_DETAILS = "cleanupdetails";
public static final String VIRTUAL_SIZE = "virtualsize";
public static final String NETSCALER_CONTROLCENTER_ID = "netscalercontrolcenterid";
public static final String NETSCALER_SERVICEPACKAGE_ID = "netscalerservicepackageid";

View File

@ -112,6 +112,10 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
@Param(description = "display name of the os on volume")
private String osDisplayName;
@SerializedName(ApiConstants.VIRTUAL_SIZE)
@Param(description = "virtual size of backedup snapshot on image store")
private long virtualSize;
@Override
public String getObjectId() {
return this.getId();
@ -221,4 +225,8 @@ public class SnapshotResponse extends BaseResponse implements ControlledEntityRe
public void setOsDisplayName(String osDisplayName) {
this.osDisplayName = osDisplayName;
}
public void setVirtualSize(long virtualSize) {
this.virtualSize = virtualSize;
}
}

View File

@ -480,6 +480,7 @@ public class ApiResponseHelper implements ResponseGenerator {
snapshotResponse.setVolumeId(volume.getUuid());
snapshotResponse.setVolumeName(volume.getName());
snapshotResponse.setVolumeType(volume.getVolumeType().name());
snapshotResponse.setVirtualSize(volume.getSize());
DataCenter zone = ApiDBUtils.findZoneById(volume.getDataCenterId());
if (zone != null) {
snapshotResponse.setZoneId(zone.getUuid());