use of com.emc.storageos.cinder.model.CinderSnapshotListRestResp in project coprhd-controller by CoprHD.
the class SnapshotService method getSnapshotList.
/**
* Get the summary list of all snapshots for the given tenant
*
* @prereq none
*
* @param tenant_id
* the URN of the tenant
*
* @brief List snapshots
* @return Snapshot list
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/detail")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public Response getSnapshotList(@PathParam("tenant_id") String openstack_tenant_id, @HeaderParam("X-Cinder-V1-Call") String isV1Call, @Context HttpHeaders header) {
CinderSnapshotListRestResp snapshots = new CinderSnapshotListRestResp();
URIQueryResultList uris = getSnapshotUris(openstack_tenant_id);
if (uris != null) {
while (uris.iterator().hasNext()) {
URI snapshotUri = uris.iterator().next();
BlockSnapshot snap = _dbClient.queryObject(BlockSnapshot.class, snapshotUri);
if (snap != null && !snap.getInactive()) {
CinderSnapshot cinder_snapshot = getSnapshotDetail(snap, isV1Call, openstack_tenant_id);
snapshots.getSnapshots().add(cinder_snapshot);
}
}
}
return CinderApiUtils.getCinderResponse(snapshots, header, false, CinderConstants.STATUS_OK);
}
Aggregations