Search in sources :

Example 1 with CifsShareRequests

use of com.emc.storageos.vnxe.requests.CifsShareRequests in project coprhd-controller by CoprHD.

the class VNXeApiClient method getCifsSharesForFileSystem.

/**
 * Find cifsShares for filesystem Id
 *
 * @param fsId
 *            file system Id
 * @return list of cifsShare
 */
public List<VNXeCifsShare> getCifsSharesForFileSystem(String fsId) {
    _logger.info("finding cifsShares for filesystem id: {} ", fsId);
    CifsShareRequests req = new CifsShareRequests(_khClient);
    List<VNXeCifsShare> shares = req.getSharesForFileSystem(fsId);
    return shares;
}
Also used : CifsShareRequests(com.emc.storageos.vnxe.requests.CifsShareRequests) VNXeCifsShare(com.emc.storageos.vnxe.models.VNXeCifsShare)

Example 2 with CifsShareRequests

use of com.emc.storageos.vnxe.requests.CifsShareRequests in project coprhd-controller by CoprHD.

the class VNXeApiClient method findCifsShareByName.

/**
 * find CIFS share by its name
 *
 * @param shareName
 *            CIFS share name
 * @return
 */
public VNXeCifsShare findCifsShareByName(String shareName) {
    CifsShareRequests req = new CifsShareRequests(_khClient);
    List<VNXeCifsShare> shares = req.getCifsShareByName(shareName);
    if (shares != null && !shares.isEmpty()) {
        return shares.get(0);
    } else {
        return null;
    }
}
Also used : CifsShareRequests(com.emc.storageos.vnxe.requests.CifsShareRequests) VNXeCifsShare(com.emc.storageos.vnxe.models.VNXeCifsShare)

Example 3 with CifsShareRequests

use of com.emc.storageos.vnxe.requests.CifsShareRequests in project coprhd-controller by CoprHD.

the class VNXeApiClient method createCifsShareForSnap.

/**
 * Create CIFS share for snapshot
 *
 * @param snapId
 *            snapshot id
 * @param shareName
 *            CIFS share name
 * @param permission
 *            READ, CHANGE, FULL
 * @return VNXeCommandJob
 * @throws VNXeException
 */
public VNXeCommandJob createCifsShareForSnap(String snapId, String shareName, String permission, String path, String fsId) throws VNXeException {
    _logger.info("Creating CIFS snapshot share name: {} for path: {}", shareName, path);
    // to get NETBIOS of CIFS Server file system is used as for snapshot
    FileSystemRequest fsRequest = new FileSystemRequest(_khClient, fsId);
    VNXeFileSystem fs = fsRequest.get();
    List<VNXeCifsServer> cifsServers = getCifsServers(fs.getNasServer().getId());
    netBios = cifsServers.get(0).getNetbiosName();
    CifsShareRequests req = new CifsShareRequests(_khClient);
    CifsShareCreateForSnapParam param = new CifsShareCreateForSnapParam();
    param.setPath(path);
    VNXeBase snap = new VNXeBase();
    snap.setId(snapId);
    if (!VNXeUtils.isHigherVersion(getBasicSystemInfo().getSoftwareVersion(), VNXeConstants.VNXE_BASE_SOFT_VER)) {
        param.setFilesystemSnap(snap);
    } else {
        param.setSnap(snap);
    }
    param.setName(shareName);
    if (permission != null && !permission.isEmpty() && permission.equalsIgnoreCase(AccessEnum.READ.name())) {
        param.setIsReadOnly(true);
    } else {
        param.setIsReadOnly(false);
    }
    return req.createShareForSnapshot(param);
}
Also used : FileSystemRequest(com.emc.storageos.vnxe.requests.FileSystemRequest) CifsShareRequests(com.emc.storageos.vnxe.requests.CifsShareRequests) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) VNXeFileSystem(com.emc.storageos.vnxe.models.VNXeFileSystem) VNXeCifsServer(com.emc.storageos.vnxe.models.VNXeCifsServer) CifsShareCreateForSnapParam(com.emc.storageos.vnxe.models.CifsShareCreateForSnapParam)

Example 4 with CifsShareRequests

use of com.emc.storageos.vnxe.requests.CifsShareRequests in project coprhd-controller by CoprHD.

the class VNXeApiClient method getCifsSharesForSnap.

/**
 * Find cifsShares for snapshot Id
 *
 * @param snapId
 *            file system snapshot Id
 * @return list of cifsShare
 */
public List<VNXeCifsShare> getCifsSharesForSnap(String snapId) {
    _logger.info("finding cifsShares for snap id: {} ", snapId);
    CifsShareRequests req = new CifsShareRequests(_khClient);
    List<VNXeCifsShare> shares = req.getSharesForFileSystemSnap(snapId);
    return shares;
}
Also used : CifsShareRequests(com.emc.storageos.vnxe.requests.CifsShareRequests) VNXeCifsShare(com.emc.storageos.vnxe.models.VNXeCifsShare)

Aggregations

CifsShareRequests (com.emc.storageos.vnxe.requests.CifsShareRequests)4 VNXeCifsShare (com.emc.storageos.vnxe.models.VNXeCifsShare)3 CifsShareCreateForSnapParam (com.emc.storageos.vnxe.models.CifsShareCreateForSnapParam)1 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)1 VNXeCifsServer (com.emc.storageos.vnxe.models.VNXeCifsServer)1 VNXeFileSystem (com.emc.storageos.vnxe.models.VNXeFileSystem)1 FileSystemRequest (com.emc.storageos.vnxe.requests.FileSystemRequest)1