Search in sources :

Example 1 with FileSystemParam

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

the class VNXeApiClient method expandFileSystem.

/**
 * expand file system
 *
 * @param fsId
 *            fileSystem Id
 * @param newSize
 *            new capacity
 * @return VNXeCommandJob
 */
public VNXeCommandJob expandFileSystem(String fsId, long newSize) {
    VNXeCommandJob job = null;
    _logger.info("expanding file system:" + fsId);
    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 fileSystemParam
    FileSystemParam fsParm = new FileSystemParam();
    fsParm.setSize(newSize);
    fsParm.setIsThinEnabled(fs.getIsThinEnabled());
    fsParm.setIsFLREnabled(fs.getIsFLREnabled());
    fsParm.setSupportedProtocols(fs.getSupportedProtocols());
    fsParm.setSizeAllocated(fs.getSizeAllocated());
    modifyFSParm.setFsParameters(fsParm);
    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) FileSystemParam(com.emc.storageos.vnxe.models.FileSystemParam) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) VNXeFileSystem(com.emc.storageos.vnxe.models.VNXeFileSystem) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemActionRequest(com.emc.storageos.vnxe.requests.FileSystemActionRequest)

Example 2 with FileSystemParam

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

the class FileSystemActionRequestTest method createFileSystem.

@Test
public void createFileSystem() {
    CreateFileSystemParam parm = new CreateFileSystemParam();
    parm.setName("test-file-03");
    FileSystemParam fsParm = new FileSystemParam();
    fsParm.setIsThinEnabled(true);
    VNXeBase nasServer = new VNXeBase();
    nasServer.setId("nas_1");
    fsParm.setNasServer(nasServer);
    VNXeBase pool = new VNXeBase();
    pool.setId("pool_1");
    fsParm.setPool(pool);
    fsParm.setSize(2200000000L);
    fsParm.setSupportedProtocols(0);
    fsParm.setIsCacheDisabled(true);
    fsParm.setSupportedProtocols(VNXeFSSupportedProtocolEnum.NFS_CIFS.getValue());
    parm.setFsParameters(fsParm);
    FileSystemActionRequest req = new FileSystemActionRequest(_client);
    VNXeCommandJob response = null;
    try {
        response = req.createFileSystemAsync(parm);
    } catch (VNXeException e) {
        // TODO Auto-generated catch block
        logger.error("VNXeException occured", e);
    }
    System.out.println(response.getId() + "state: " + response.getState());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemParam(com.emc.storageos.vnxe.models.FileSystemParam) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) VNXeException(com.emc.storageos.vnxe.VNXeException) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) Test(org.junit.Test)

Example 3 with FileSystemParam

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

the class FileSystemActionRequestTest method expandFileSystem.

// @Test
public void expandFileSystem() {
    String resourceId = "res_4";
    long newSize = 2000000000L;
    ModifyFileSystemParam modifyFSParm = new ModifyFileSystemParam();
    // set fileSystemParam
    FileSystemParam fsParm = new FileSystemParam();
    fsParm.setSize(newSize);
    modifyFSParm.setFsParameters(fsParm);
    FileSystemActionRequest req = new FileSystemActionRequest(_client);
    VNXeCommandJob job = req.modifyFileSystemAsync(modifyFSParm, resourceId);
    System.out.println(job.getId());
}
Also used : VNXeCommandJob(com.emc.storageos.vnxe.models.VNXeCommandJob) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) FileSystemParam(com.emc.storageos.vnxe.models.FileSystemParam) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam)

Example 4 with FileSystemParam

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

the class VNXeApiClient method createFileSystem.

/**
 * create file system
 *
 * @param fsName
 *            file system name.
 * @param size
 *            size in byte.
 * @param poolId
 *            pool id.
 * @param nasServerId
 *            nasServer id.
 * @param isThin
 *            is thin enabled.
 * @param supportedProtocols
 * @return VNXeCommandJob
 * @throws VNXeException
 */
public VNXeCommandJob createFileSystem(String fsName, long size, String poolId, String nasServerId, boolean isThin, VNXeFSSupportedProtocolEnum supportedProtocols) throws VNXeException {
    _logger.info("Creating file system:" + fsName);
    CreateFileSystemParam parm = new CreateFileSystemParam();
    parm.setName(fsName);
    FileSystemParam fsParm = new FileSystemParam();
    fsParm.setIsThinEnabled(isThin);
    VNXeBase nasServer = new VNXeBase();
    nasServer.setId(nasServerId);
    fsParm.setNasServer(nasServer);
    VNXeBase pool = new VNXeBase();
    pool.setId(poolId);
    fsParm.setPool(pool);
    fsParm.setSize(size);
    fsParm.setSupportedProtocols(supportedProtocols.getValue());
    parm.setFsParameters(fsParm);
    FileSystemActionRequest req = new FileSystemActionRequest(_khClient);
    _logger.info("submitted the create file system job for " + fsName);
    return req.createFileSystemAsync(parm);
}
Also used : VNXeBase(com.emc.storageos.vnxe.models.VNXeBase) FileSystemParam(com.emc.storageos.vnxe.models.FileSystemParam) ModifyFileSystemParam(com.emc.storageos.vnxe.models.ModifyFileSystemParam) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) CreateFileSystemParam(com.emc.storageos.vnxe.models.CreateFileSystemParam) FileSystemActionRequest(com.emc.storageos.vnxe.requests.FileSystemActionRequest)

Aggregations

CreateFileSystemParam (com.emc.storageos.vnxe.models.CreateFileSystemParam)4 FileSystemParam (com.emc.storageos.vnxe.models.FileSystemParam)4 ModifyFileSystemParam (com.emc.storageos.vnxe.models.ModifyFileSystemParam)4 VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)3 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)2 FileSystemActionRequest (com.emc.storageos.vnxe.requests.FileSystemActionRequest)2 VNXeException (com.emc.storageos.vnxe.VNXeException)1 VNXeFileSystem (com.emc.storageos.vnxe.models.VNXeFileSystem)1 FileSystemRequest (com.emc.storageos.vnxe.requests.FileSystemRequest)1 Test (org.junit.Test)1