return response;
}
@Override
public SnapshotScheduleResponse createSnapshotScheduleResponse(SnapshotSchedule snapshotSchedule) {
SnapshotScheduleResponse response = new SnapshotScheduleResponse();
response.setId(snapshotSchedule.getUuid());
if (snapshotSchedule.getVolumeId() != null) {
Volume vol = ApiDBUtils.findVolumeById(snapshotSchedule.getVolumeId());
if (vol != null) {
response.setVolumeId(vol.getUuid());
}
}
if (snapshotSchedule.getPolicyId() != null) {
SnapshotPolicy policy = ApiDBUtils.findSnapshotPolicyById(snapshotSchedule.getPolicyId());
if (policy != null) {
response.setSnapshotPolicyId(policy.getUuid());
}
}
response.setScheduled(snapshotSchedule.getScheduledTimestamp());
response.setObjectName("snapshot");
return response;
}