Search in sources :

Example 1 with CifsShareDeleteParam

use of com.emc.storageos.vnxe.models.CifsShareDeleteParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method removeCifsShare.

/**
 * Delete cifsShare
 *
 * @param cifsShareId
 *            cifsShare Id
 * @param fsId
 *            file system Id
 * @return VNXeCommandJob
 */
public VNXeCommandJob removeCifsShare(String cifsShareId, String fsId) {
    VNXeCommandJob job = null;
    _logger.info("deleting cifs share" + cifsShareId);
    FileSystemRequest fsRequest = new FileSystemRequest(_khClient, fsId);
    VNXeFileSystem fs = fsRequest.get();
    if (fs == null) {
        _logger.info("Could not find file system in the vxne");
        throw VNXeException.exceptions.vnxeCommandFailed("Could not find file system in the vnxe for: " + fsId);
    }
    String resourceId = fs.getStorageResource().getId();
    ModifyFileSystemParam modifyFSParm = new ModifyFileSystemParam();
    // set cifsShare delete parm
    CifsShareDeleteParam deleteParam = new CifsShareDeleteParam();
    VNXeBase share = new VNXeBase();
    share.setId(cifsShareId);
    deleteParam.setCifsShare(share);
    List<CifsShareDeleteParam> deleteList = new ArrayList<CifsShareDeleteParam>();
    deleteList.add(deleteParam);
    modifyFSParm.setCifsShareDelete(deleteList);
    FileSystemActionRequest req = new FileSystemActionRequest(_khClient);
    job = req.modifyFileSystemAsync(modifyFSParm, resourceId);
    return job;
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) FileSystemRequest(com.emc.storageos.vnxe.requests.FileSystemRequest) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) CifsShareDeleteParam(com.emc.storageos.vnxe.models.CifsShareDeleteParam) VNXeFileSystem(com.emc.storageos.vnxe.models.VNXeFileSystem) ArrayList(java.util.ArrayList) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemActionRequest(com.emc.storageos.vnxe.requests.FileSystemActionRequest)

Aggregations

CifsShareDeleteParam (com.emc.storageos.vnxe.models.CifsShareDeleteParam)1 ModifyFileSystemParam (com.emc.storageos.vnxe.models.ModifyFileSystemParam)1 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)1 VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)1 VNXeFileSystem (com.emc.storageos.vnxe.models.VNXeFileSystem)1 FileSystemActionRequest (com.emc.storageos.vnxe.requests.FileSystemActionRequest)1 FileSystemRequest (com.emc.storageos.vnxe.requests.FileSystemRequest)1 ArrayList (java.util.ArrayList)1