use of com.emc.storageos.model.block.UnManagedExportMaskList in project coprhd-controller by CoprHD.
the class ClusterService method getUnmanagedExportMasks.
/**
* Gets the UnManagedExportMasks found for a Cluster.
*
* @param id the URI of a ViPR Cluster
* @brief List unmanaged export masks for a cluster
* @return a list of UnManagedExportMasks found for the Cluster
* @throws DatabaseException when a database error occurs
*/
@GET
@Path("/{id}/unmanaged-export-masks")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public UnManagedExportMaskList getUnmanagedExportMasks(@PathParam("id") URI id) throws DatabaseException {
Cluster cluster = queryObject(Cluster.class, id, false);
// check the user permissions
verifyAuthorizedInTenantOrg(cluster.getTenant(), getUserFromContext());
// get the unmanaged export masks
List<UnManagedExportMask> uems = VolumeIngestionUtil.findUnManagedExportMasksForCluster(id, _dbClient);
UnManagedExportMaskList list = new UnManagedExportMaskList();
for (UnManagedExportMask uem : uems) {
list.getUnManagedExportMasks().add(toRelatedResource(ResourceTypeEnum.UNMANAGED_EXPORT_MASKS, uem.getId()));
}
return list;
}
use of com.emc.storageos.model.block.UnManagedExportMaskList in project coprhd-controller by CoprHD.
the class HostService method getUnmanagedExportMasks.
/**
* Gets the UnManagedExportMasks found for a Host.
*
* @param id
* the URI of a ViPR Host
* @brief List unmanaged export masks for a host
* @return a list of UnManagedExportMasks found for the Host
* @throws DatabaseException
* when a database error occurs
*/
@GET
@Path("/{id}/unmanaged-export-masks")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public UnManagedExportMaskList getUnmanagedExportMasks(@PathParam("id") URI id) throws DatabaseException {
Host host = queryObject(Host.class, id, false);
// check the user permissions
verifyAuthorizedInTenantOrg(host.getTenant(), getUserFromContext());
// get the unmanaged export masks
List<UnManagedExportMask> uems = VolumeIngestionUtil.findUnManagedExportMasksForHost(id, _dbClient);
UnManagedExportMaskList list = new UnManagedExportMaskList();
for (UnManagedExportMask uem : uems) {
list.getUnManagedExportMasks().add(toRelatedResource(ResourceTypeEnum.UNMANAGED_EXPORT_MASKS, uem.getId()));
}
return list;
}
Aggregations