Search in sources :

Example 1 with CreateFileSystemParam

use of com.emc.storageos.vnxe.models.CreateFileSystemParam 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 2 with CreateFileSystemParam

use of com.emc.storageos.vnxe.models.CreateFileSystemParam 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)2 FileSystemParam (com.emc.storageos.vnxe.models.FileSystemParam)2 ModifyFileSystemParam (com.emc.storageos.vnxe.models.ModifyFileSystemParam)2 VNXeBase (com.emc.storageos.vnxe.models.VNXeBase)2 VNXeException (com.emc.storageos.vnxe.VNXeException)1 VNXeCommandJob (com.emc.storageos.vnxe.models.VNXeCommandJob)1 FileSystemActionRequest (com.emc.storageos.vnxe.requests.FileSystemActionRequest)1 Test (org.junit.Test)1