Search in sources :

Example 1 with QuotaDirectoryList

use of com.emc.storageos.model.file.QuotaDirectoryList in project coprhd-controller by CoprHD.

the class FileService method getQuotaDirectoryList.

/**
 * Get list of quota directories for the specified file system.
 *
 * @param id
 *            the URN of a ViPR File system
 * @brief List file system quota directories
 * @return List of file system quota directories.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/quota-directories")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public QuotaDirectoryList getQuotaDirectoryList(@PathParam("id") URI id) {
    _log.info(String.format("Get list of quota directories for file system: %1$s", id));
    ArgValidator.checkFieldUriType(id, FileShare.class, "id");
    FileShare fileShare = queryResource(id);
    QuotaDirectoryList quotaDirList = new QuotaDirectoryList();
    if (fileShare.getInactive()) {
        return quotaDirList;
    }
    // Get SMB share map from file system
    List<QuotaDirectory> quotaDirs = queryDBQuotaDirectories(fileShare);
    // Process each share from the map and add its data to shares in response list.
    for (QuotaDirectory quotaDir : quotaDirs) {
        quotaDirList.getQuotaDirs().add(toNamedRelatedResource(quotaDir));
    }
    return quotaDirList;
}
Also used : QuotaDirectoryList(com.emc.storageos.model.file.QuotaDirectoryList) QuotaDirectory(com.emc.storageos.db.client.model.QuotaDirectory) FileShareQuotaDirectory(com.emc.storageos.volumecontroller.FileShareQuotaDirectory) FileShare(com.emc.storageos.db.client.model.FileShare) SMBFileShare(com.emc.storageos.db.client.model.SMBFileShare) MapFileShare(com.emc.storageos.api.mapper.functions.MapFileShare) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

MapFileShare (com.emc.storageos.api.mapper.functions.MapFileShare)1 FileShare (com.emc.storageos.db.client.model.FileShare)1 QuotaDirectory (com.emc.storageos.db.client.model.QuotaDirectory)1 SMBFileShare (com.emc.storageos.db.client.model.SMBFileShare)1 QuotaDirectoryList (com.emc.storageos.model.file.QuotaDirectoryList)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 FileShareQuotaDirectory (com.emc.storageos.volumecontroller.FileShareQuotaDirectory)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1