response.setDeleteSnapshotResponse(param1);
return response;
}
public static CreateSnapshotResponse toCreateSnapshotResponse(EC2Snapshot engineResponse, EC2Engine engine) {
CreateSnapshotResponse response = new CreateSnapshotResponse();
CreateSnapshotResponseType param1 = new CreateSnapshotResponseType();
String accountName = engineResponse.getAccountName();
String domainId = engineResponse.getDomainId().toString();
String ownerId = domainId + ":" + accountName;
param1.setSnapshotId(engineResponse.getId().toString());
param1.setVolumeId(engineResponse.getVolumeId().toString());
param1.setStatus("completed");
// -> CloudStack seems to have issues with timestamp formats so just in case
Calendar cal = engineResponse.getCreated();
if (null == cal) {
cal = Calendar.getInstance();
cal.set(1970, 1, 1);
}
param1.setStartTime(cal);
param1.setProgress("100");
param1.setOwnerId(ownerId);
Long volSize = new Long(engineResponse.getVolumeSize());
param1.setVolumeSize(volSize.toString());
param1.setDescription(engineResponse.getName());
param1.setRequestId(UUID.randomUUID().toString());
response.setCreateSnapshotResponse(param1);
return response;
}