use of com.emc.storageos.vnxe.models.CifsShareCreateForSnapParam 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);
}
Aggregations