use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class DriverSimulatorTask method abort.
public DriverTask abort(DriverTask task) {
DriverTask abortTaskTask = new DriverTask("AbortTask_" + getTaskId()) {
public DriverTask abort(DriverTask task) {
throw new UnsupportedOperationException("Cannot abort abort task");
}
};
abortTaskTask.setStatus(TaskStatus.FAILED);
abortTaskTask.setMessage("Operation is not supported for simulator tasks.");
return abortTaskTask;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method restoreFromClone.
@Override
public DriverTask restoreFromClone(List<VolumeClone> clones) {
RestoreFromCloneSimulatorOperation restoreCloneSimulatorOperation = new RestoreFromCloneSimulatorOperation(clones);
if (simulatorConfig.getSimulateAsynchronousResponses()) {
DriverTask driverTask = restoreCloneSimulatorOperation.getDriverTask();
taskOperationMap.put(driverTask.getTaskId(), restoreCloneSimulatorOperation);
return driverTask;
} else if (simulatorConfig.getSimulateFailures()) {
String failMsg = restoreCloneSimulatorOperation.getFailureMessage();
return restoreCloneSimulatorOperation.doFailure(failMsg);
} else {
restoreCloneSimulatorOperation.updateCloneInfo(clones);
String successMsg = restoreCloneSimulatorOperation.getSuccessMessage(clones);
return restoreCloneSimulatorOperation.doSuccess(successMsg);
}
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method unexportVolumesFromInitiators.
@Override
public DriverTask unexportVolumesFromInitiators(List<Initiator> initiators, List<StorageVolume> volumes) {
String taskType = "unexport-volumes-from-initiators";
String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
DriverTask task = new DriverSimulatorTask(taskId);
task.setStatus(DriverTask.TaskStatus.READY);
String msg = String.format("StorageDriver: unexportVolumesFromInitiators: export type %s, initiators %s .", initiators.get(0).getInitiatorType(), initiators.toString());
_log.info(msg);
task.setMessage(msg);
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method removeVolumesFromConsistencyGroup.
@Override
public DriverTask removeVolumesFromConsistencyGroup(List<StorageVolume> volumes, StorageCapabilities capabilities) {
_log.info("Remove {} Volumes from Consistency Group {}", volumes.toString(), volumes.get(0).getConsistencyGroup());
String taskType = "remove-volumes-to-consistency-groupd";
String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
DriverTask task = new DriverSimulatorTask(taskId);
task.setStatus(DriverTask.TaskStatus.READY);
String msg = String.format("StorageDriver: removeVolumesFromConsistencyGroup information for storage system %s, volume nativeIds %s, Consistency Group - end", volumes.get(0).getStorageSystemId(), volumes.toString());
_log.info(msg);
task.setMessage(msg);
return task;
}
use of com.emc.storageos.storagedriver.DriverTask in project coprhd-controller by CoprHD.
the class StorageDriverSimulator method deleteVolume.
@Override
public DriverTask deleteVolume(StorageVolume volume) {
String taskType = "delete-storage-volumes";
String taskId = String.format("%s+%s+%s", DRIVER_NAME, taskType, UUID.randomUUID().toString());
DriverTask task = new DriverSimulatorTask(taskId);
task.setStatus(DriverTask.TaskStatus.READY);
_log.info("StorageDriver: deleteVolumes information for storage system {}, volume nativeIds {} - end", volume.getStorageSystemId(), volume.toString());
return task;
}
Aggregations