use of com.emc.nas.vnxfile.xmlapi.ModifyFileSystem in project coprhd-controller by CoprHD.
the class VNXFileArgsCreator method doModifyFS.
public InputStream doModifyFS(final Argument argument, final Map<String, Object> keyMap, int index) throws VNXFilePluginException {
_logger.info("ArgsCreator: VNX File Modify");
InputStream iStream = null;
try {
// Verify that the prior command executed properly.
verifyPreviousResults(keyMap);
Task task = new Task();
ModifyFileSystem modifyFS = new ModifyFileSystem();
FileSystem fsSystem = (FileSystem) keyMap.get(VNXFileConstants.FILESYSTEM);
String fsName = (String) keyMap.get(VNXFileConstants.FILESYSTEM_NAME);
String fsId = (String) keyMap.get(VNXFileConstants.FILESYSTEM_ID);
Long size = (Long) keyMap.get(VNXFileConstants.FILESYSTEM_SIZE);
Boolean isVirtualProvisioning = (Boolean) keyMap.get(VNXFileConstants.FILESYSTEM_VIRTUAL_PROVISIONING);
if (null == fsSystem || isInValid(fsName) || isInValid(fsId) || null == size) {
throw new VNXFilePluginException("Prior command did not execute successfully", VNXFilePluginException.ERRORCODE_ILLEGALARGUMENTEXCEPTION);
}
modifyFS.setVirtualProvisioning(isVirtualProvisioning);
if (isVirtualProvisioning) {
AutoExtend autoExtend = new AutoExtend();
autoExtend.setHighWaterMark(EXT_HW_MARK);
autoExtend.setAutoExtensionMaxSize(size);
modifyFS.setAutoExtend(autoExtend);
}
_logger.info("Modifying File system max size : {}, name {}", size, fsName);
modifyFS.setFileSystem(fsSystem.getFileSystem());
task.setModifyFileSystem(modifyFS);
iStream = _vnxFileInputRequestBuilder.getTaskParamPacket(task, true);
} catch (JAXBException jaxbException) {
throw new VNXFilePluginException("Exception occurred while fetching fileSystem info", jaxbException.getCause());
}
return iStream;
}
Aggregations