use of com.emc.storageos.cinder.model.VolumeDetails in project coprhd-controller by CoprHD.
the class VolumeService method getDetailedVolumeList.
/**
* Get the detailed list of all volumes for the given tenant
*
* @prereq none
*
* @param tenant_id the URN of the tenant
*
* @brief List volumes in detail
* @return Volume detailed list
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/detail")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public Response getDetailedVolumeList(@PathParam("tenant_id") String openstackTenantId, @HeaderParam("X-Cinder-V1-Call") String isV1Call, @Context HttpHeaders header) {
_log.debug("START get detailed volume list");
URIQueryResultList uris = getVolumeUris(openstackTenantId);
// convert to detailed format
VolumeDetails volumeDetails = new VolumeDetails();
if (uris != null) {
for (URI volumeUri : uris) {
Volume vol = _dbClient.queryObject(Volume.class, volumeUri);
if (vol != null && !vol.getInactive()) {
VolumeDetail volumeDetail = getVolumeDetail(vol, isV1Call, openstackTenantId);
volumeDetails.getVolumes().add(volumeDetail);
}
}
}
return CinderApiUtils.getCinderResponse(volumeDetails, header, false, STATUS_OK);
}
Aggregations