Search in sources :

Example 1 with MountInfoList

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

the class FileService method getMountListForFS.

/**
 * Get list of mounts for the specified file system.
 *
 * @param id
 *            the URN of a ViPR File system
 * @brief List file system mounts
 * @return List of file system mounts.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/mount")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public MountInfoList getMountListForFS(@PathParam("id") URI id) {
    ArgValidator.checkFieldUriType(id, FileShare.class, "id");
    _log.info(String.format("Get list of file system mounts: %1$s", id));
    MountInfoList mountList = new MountInfoList();
    mountList.setMountList(FileOperationUtils.queryDBFSMounts(id, _dbClient));
    return mountList;
}
Also used : MountInfoList(com.emc.storageos.model.file.MountInfoList) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 2 with MountInfoList

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

the class FileSystems method getNfsMountsByHost.

/**
 * Gets the NFS mounts for the given host
 * <p>
 * API Call: <tt>GET /compute/hosts/{id}/filesystem-mounts</tt>
 *
 * @param id
 *            the ID of the host.
 * @return the list of NFS mounts for the host.
 */
public List<MountInfo> getNfsMountsByHost(URI id) {
    MountInfoList response;
    response = client.get(MountInfoList.class, getNfsHostMountsUrl(), id);
    return defaultList(response.getMountList());
}
Also used : MountInfoList(com.emc.storageos.model.file.MountInfoList)

Example 3 with MountInfoList

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

the class HostService method getHostNFSMounts.

/**
 * Get list of file system mounts for the specified host.
 *
 * @param id
 *            the URN of a host
 * @brief List file system mounts
 * @return List of file system mounts.
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/filesystem-mounts")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public MountInfoList getHostNFSMounts(@PathParam("id") URI id) {
    ArgValidator.checkFieldUriType(id, Host.class, "id");
    _log.info(String.format("Get list of mounts for host %1$s", id));
    Host host = queryObject(Host.class, id, false);
    // check the user permissions
    verifyAuthorizedInTenantOrg(host.getTenant(), getUserFromContext());
    MountInfoList mountList = new MountInfoList();
    mountList.setMountList(FileOperationUtils.queryDBHostMounts(id, _dbClient));
    return mountList;
}
Also used : Host(com.emc.storageos.db.client.model.Host) MountInfoList(com.emc.storageos.model.file.MountInfoList) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

MountInfoList (com.emc.storageos.model.file.MountInfoList)3 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2 Host (com.emc.storageos.db.client.model.Host)1