use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class GetBlockResource method executeTask.
@SuppressWarnings("incomplete-switch")
@Override
public BlockObjectRestRep executeTask() throws Exception {
ViPRCoreClient client = getClient();
ResourceType volumeType = ResourceType.fromResourceId(resourceId.toString());
switch(volumeType) {
case VOLUME:
VolumeRestRep volume = client.blockVolumes().get(resourceId);
if (volume != null) {
return volume;
}
break;
case BLOCK_SNAPSHOT:
BlockSnapshotRestRep snapshot = client.blockSnapshots().get(resourceId);
if (snapshot != null) {
return snapshot;
}
break;
}
throw stateException("GetBlockResource.illegalState.notFound", resourceId);
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class GetMobilityGroupVolumesByCluster method executeTask.
@Override
public Set<URI> executeTask() throws Exception {
Set<URI> mobilityGroupVolumes = Sets.newHashSet();
Set<URI> volumes = getHostExportedVolumes();
for (URI volume : volumes) {
VolumeRestRep vol = getClient().blockVolumes().get(volume);
StorageSystemRestRep storage = getClient().storageSystems().get(vol.getStorageController());
if (BlockStorageUtils.isVplexVolume(vol, storage.getSystemType())) {
mobilityGroupVolumes.add(volume);
}
}
return mobilityGroupVolumes;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class AddVolumesToConsistencyGroupService method getFullCopies.
/**
* Get full copies for a given volume id
*
* @param volumeId the volume id to use
* @return list of full copy ids
*/
public List<URI> getFullCopies(URI volumeId) {
List<URI> fullCopies = Lists.newArrayList();
List<VolumeRestRep> fullCopyRestReps = execute(new GetActiveFullCopiesForVolume(volumeId));
for (VolumeRestRep fullCopyId : fullCopyRestReps) {
fullCopies.add(fullCopyId.getId());
}
return fullCopies;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockStorageUtils method createMultipleVolumes.
public static List<URI> createMultipleVolumes(List<? extends CreateBlockVolumeHelper> helpers) {
Tasks<VolumeRestRep> tasks = execute(new CreateMultipleBlockVolumes(helpers));
List<URI> volumeIds = Lists.newArrayList();
for (Task<VolumeRestRep> task : tasks.getTasks()) {
URI volumeId = task.getResourceId();
addAffectedResource(volumeId);
volumeIds.add(volumeId);
}
addRollback(new DeactivateVolumes(volumeIds, VolumeDeleteTypeEnum.FULL));
return volumeIds;
}
use of com.emc.storageos.model.block.VolumeRestRep in project coprhd-controller by CoprHD.
the class BlockStorageUtils method addJournalCapacity.
public static List<URI> addJournalCapacity(URI projectId, URI virtualArrayId, URI virtualPoolId, double sizeInGb, Integer count, URI consistencyGroupId, String copyName) {
String volumeSize = gbToVolumeSize(sizeInGb);
Tasks<VolumeRestRep> tasks = execute(new AddJournalCapacity(virtualPoolId, virtualArrayId, projectId, volumeSize, count, consistencyGroupId, copyName));
List<URI> volumeIds = Lists.newArrayList();
for (Task<VolumeRestRep> task : tasks.getTasks()) {
URI volumeId = task.getResourceId();
addAffectedResource(volumeId);
volumeIds.add(volumeId);
}
return volumeIds;
}
Aggregations