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