Search in sources :

Example 1 with UnManagedExportMaskList

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;
}
Also used : UnManagedExportMaskList(com.emc.storageos.model.block.UnManagedExportMaskList) MapCluster(com.emc.storageos.api.mapper.functions.MapCluster) Cluster(com.emc.storageos.db.client.model.Cluster) UnManagedExportMask(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedExportMask) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 2 with UnManagedExportMaskList

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;
}
Also used : UnManagedExportMaskList(com.emc.storageos.model.block.UnManagedExportMaskList) Host(com.emc.storageos.db.client.model.Host) UnManagedExportMask(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedExportMask) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Aggregations

UnManagedExportMask (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedExportMask)2 UnManagedExportMaskList (com.emc.storageos.model.block.UnManagedExportMaskList)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 MapCluster (com.emc.storageos.api.mapper.functions.MapCluster)1 Cluster (com.emc.storageos.db.client.model.Cluster)1 Host (com.emc.storageos.db.client.model.Host)1