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());
}
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);
}
Aggregations