Search in sources :

Example 1 with SnapshotSchedule

use of com.cloud.storage.snapshot.SnapshotSchedule in project CloudStack-archive by CloudStack-extras.

the class ListRecurringSnapshotScheduleCmd method execute.

@Override
public void execute() {
    List<? extends SnapshotSchedule> snapshotSchedules = _snapshotService.findRecurringSnapshotSchedule(this);
    ListResponse<SnapshotScheduleResponse> response = new ListResponse<SnapshotScheduleResponse>();
    List<SnapshotScheduleResponse> snapshotScheduleResponses = new ArrayList<SnapshotScheduleResponse>();
    for (SnapshotSchedule snapshotSchedule : snapshotSchedules) {
        SnapshotScheduleResponse snapSchedResponse = new SnapshotScheduleResponse();
        snapSchedResponse.setId(snapshotSchedule.getId());
        snapSchedResponse.setVolumeId(snapshotSchedule.getVolumeId());
        snapSchedResponse.setSnapshotPolicyId(snapshotSchedule.getPolicyId());
        snapSchedResponse.setScheduled(snapshotSchedule.getScheduledTimestamp());
        snapSchedResponse.setObjectName("snapshot");
        snapshotScheduleResponses.add(snapSchedResponse);
    }
    response.setResponses(snapshotScheduleResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : ListResponse(com.cloud.api.response.ListResponse) SnapshotScheduleResponse(com.cloud.api.response.SnapshotScheduleResponse) ArrayList(java.util.ArrayList) SnapshotSchedule(com.cloud.storage.snapshot.SnapshotSchedule)

Example 2 with SnapshotSchedule

use of com.cloud.storage.snapshot.SnapshotSchedule in project cloudstack by apache.

the class ListRecurringSnapshotScheduleCmd method execute.

@Override
public void execute() {
    List<? extends SnapshotSchedule> snapshotSchedules = _snapshotService.findRecurringSnapshotSchedule(this);
    ListResponse<SnapshotScheduleResponse> response = new ListResponse<SnapshotScheduleResponse>();
    List<SnapshotScheduleResponse> snapshotScheduleResponses = new ArrayList<SnapshotScheduleResponse>();
    for (SnapshotSchedule snapshotSchedule : snapshotSchedules) {
        SnapshotScheduleResponse snapSchedResponse = _responseGenerator.createSnapshotScheduleResponse(snapshotSchedule);
        snapshotScheduleResponses.add(snapSchedResponse);
    }
    response.setResponses(snapshotScheduleResponses);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
}
Also used : ListResponse(org.apache.cloudstack.api.response.ListResponse) SnapshotScheduleResponse(org.apache.cloudstack.api.response.SnapshotScheduleResponse) ArrayList(java.util.ArrayList) SnapshotSchedule(com.cloud.storage.snapshot.SnapshotSchedule)

Aggregations

SnapshotSchedule (com.cloud.storage.snapshot.SnapshotSchedule)2 ArrayList (java.util.ArrayList)2 ListResponse (com.cloud.api.response.ListResponse)1 SnapshotScheduleResponse (com.cloud.api.response.SnapshotScheduleResponse)1 ListResponse (org.apache.cloudstack.api.response.ListResponse)1 SnapshotScheduleResponse (org.apache.cloudstack.api.response.SnapshotScheduleResponse)1