Search in sources :

Example 1 with NfsShareDeleteParam

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

the class VNXeApiClient method removeNfsShare.

/**
 * Delete nfsShare
 *
 * @param nfsShareId
 *            nfsShare Id
 * @param fsId
 *            file system Id
 * @return VNXeCommandJob
 */
public VNXeCommandJob removeNfsShare(String nfsShareId, String fsId) {
    VNXeCommandJob job = null;
    _logger.info("unexporting file system:" + fsId);
    FileSystemRequest fsRequest = new FileSystemRequest(_khClient, fsId);
    VNXeFileSystem fs = fsRequest.get();
    if (fs == null) {
        _logger.error("Could not find file system in the vxne");
        throw VNXeException.exceptions.vnxeCommandFailed("Could not find file system in the vnxe for: " + fsId);
    }
    if (nfsShareId == null || nfsShareId.isEmpty()) {
        _logger.error("NfsShareId is empty.");
        throw VNXeException.exceptions.vnxeCommandFailed("NfsShareId is empty. ");
    }
    String resourceId = fs.getStorageResource().getId();
    ModifyFileSystemParam modifyFSParm = new ModifyFileSystemParam();
    // set NfsShare delete parm
    NfsShareDeleteParam deleteParam = new NfsShareDeleteParam();
    VNXeBase share = new VNXeBase();
    share.setId(nfsShareId);
    deleteParam.setNfsShare(share);
    List<NfsShareDeleteParam> deleteList = new ArrayList<NfsShareDeleteParam>();
    deleteList.add(deleteParam);
    modifyFSParm.setNfsShareDelete(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) NfsShareDeleteParam(com.emc.storageos.vnxe.models.NfsShareDeleteParam) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) 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)

Example 2 with NfsShareDeleteParam

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

the class FileSystemActionRequestTest method removeNfsShare.

// @Test
public void removeNfsShare() {
    ModifyFileSystemParam parm = new ModifyFileSystemParam();
    NfsShareDeleteParam nfsShareParm = new NfsShareDeleteParam();
    VNXeBase nfs = new VNXeBase();
    nfs.setId("NFSShare_1");
    nfsShareParm.setNfsShare(nfs);
    List<NfsShareDeleteParam> shares = new ArrayList<NfsShareDeleteParam>();
    shares.add(nfsShareParm);
    parm.setNfsShareDelete(shares);
    FileSystemActionRequest req = new FileSystemActionRequest(_client);
    VNXeCommandJob job = req.modifyFileSystemAsync(parm, "res_4");
    System.out.println(job.getId());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) NfsShareDeleteParam(com.emc.storageos.vnxe.models.NfsShareDeleteParam) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) ArrayList(java.util.ArrayList) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam)

Aggregations

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