use of com.emc.storageos.model.block.NamedVolumesList in project coprhd-controller by CoprHD.
the class VolumeGroupService method getVolumes.
/**
* Get application volumes
*
* @param id Application Id
* @brief List volumes for an application
* @return NamedVolumesList
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/volumes")
public NamedVolumesList getVolumes(@PathParam("id") URI id) {
ArgValidator.checkFieldUriType(id, VolumeGroup.class, "id");
VolumeGroup volumeGroup = (VolumeGroup) queryResource(id);
NamedVolumesList result = new NamedVolumesList();
List<Volume> volumes = ControllerUtils.getVolumeGroupVolumes(_dbClient, volumeGroup);
for (Volume volume : volumes) {
result.getVolumes().add(toNamedRelatedResource(volume));
}
return result;
}
use of com.emc.storageos.model.block.NamedVolumesList in project coprhd-controller by CoprHD.
the class BlockFullCopyManager method getFullCopiesForSource.
/**
* Returns the full copies for the source volume with the passed URI.
*
* @param sourceVolumeURI The URI of the full copy source volume.
*
* @return NamedVolumesList
*/
public NamedVolumesList getFullCopiesForSource(URI sourceVolumeURI) {
NamedVolumesList fullCopyList = new NamedVolumesList();
ArgValidator.checkFieldUriType(sourceVolumeURI, Volume.class, "id");
Volume sourceVolume = _dbClient.queryObject(Volume.class, sourceVolumeURI);
StringSet fullCopyIds = sourceVolume.getFullCopies();
if (fullCopyIds == null || fullCopyIds.isEmpty()) {
return fullCopyList;
}
for (String fullCopyId : fullCopyIds) {
Volume fullCopyVolume = _dbClient.queryObject(Volume.class, URI.create(fullCopyId));
if (fullCopyVolume == null || fullCopyVolume.getInactive()) {
s_logger.warn("Stale full copy {} found for volume {}", fullCopyId, sourceVolumeURI);
continue;
}
fullCopyList.getVolumes().add(DbObjectMapper.toNamedRelatedResource(fullCopyVolume));
}
return fullCopyList;
}
Aggregations