use of com.emc.storageos.vnxe.models.VNXeFileSystem in project coprhd-controller by CoprHD.
the class VNXeExpandFileSystemJob method updateFS.
/**
* update FileShare after expanded in VNXe
*
* @param fsId fileShare uri in vipr
* @param dbClient DbClient
* @param logMsgBuilder string builder for logging
* @param vnxeApiClient VNXeApiClient
*/
private void updateFS(FileShare fsObj, DbClient dbClient, StringBuilder logMsgBuilder, VNXeApiClient vnxeApiClient) {
VNXeFileSystem vnxeFS = null;
vnxeFS = vnxeApiClient.getFileSystemByFSId(fsObj.getNativeId());
if (vnxeFS != null) {
fsObj.setCapacity(vnxeFS.getSizeTotal());
logMsgBuilder.append(String.format("Expand file system successfully for NativeId: %s, URI: %s", fsObj.getNativeId(), getTaskCompleter().getId()));
dbClient.persistObject(fsObj);
} else {
logMsgBuilder.append("Could not find corresponding file system in the VNXe, using the fs ID: ");
logMsgBuilder.append(fsObj.getNativeId());
logMsgBuilder.append(" having name: ");
logMsgBuilder.append(fsObj.getName());
}
}
use of com.emc.storageos.vnxe.models.VNXeFileSystem 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.VNXeFileSystem in project coprhd-controller by CoprHD.
the class VNXeApiClient method removeNfsShare.
/**
* Delete nfsShare
*
* @param nfsShareId
* nfsShare Id
* @param fsId
* file system Id
* @return VNXeCommandJob
*/
public VNXeCommandJob removeNfsShare(String nfsShareId, String fsId) {
VNXeCommandJob job = null;
_logger.info("unexporting file system:" + fsId);
FileSystemRequest fsRequest = new FileSystemRequest(_khClient, fsId);
VNXeFileSystem fs = fsRequest.get();
if (fs == null) {
_logger.error("Could not find file system in the vxne");
throw VNXeException.exceptions.vnxeCommandFailed("Could not find file system in the vnxe for: " + fsId);
}
if (nfsShareId == null || nfsShareId.isEmpty()) {
_logger.error("NfsShareId is empty.");
throw VNXeException.exceptions.vnxeCommandFailed("NfsShareId is empty. ");
}
String resourceId = fs.getStorageResource().getId();
ModifyFileSystemParam modifyFSParm = new ModifyFileSystemParam();
// set NfsShare delete parm
NfsShareDeleteParam deleteParam = new NfsShareDeleteParam();
VNXeBase share = new VNXeBase();
share.setId(nfsShareId);
deleteParam.setNfsShare(share);
List<NfsShareDeleteParam> deleteList = new ArrayList<NfsShareDeleteParam>();
deleteList.add(deleteParam);
modifyFSParm.setNfsShareDelete(deleteList);
FileSystemActionRequest req = new FileSystemActionRequest(_khClient);
job = req.modifyFileSystemAsync(modifyFSParm, resourceId);
return job;
}
use of com.emc.storageos.vnxe.models.VNXeFileSystem in project coprhd-controller by CoprHD.
the class FileSystemListRequest method getByStorageResource.
/**
* Get file system using its storageResourceId
*
* @param storageResourceId
* @return
*/
public VNXeFileSystem getByStorageResource(String storageResourceId) {
MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
queryParams.add(VNXeConstants.FILTER, VNXeConstants.STORAGE_RESOURCE_FILTER + "\"" + storageResourceId + "\"");
setQueryParameters(queryParams);
VNXeFileSystem result = null;
List<VNXeFileSystem> fsList = getDataForObjects(VNXeFileSystem.class);
// it should just return 1
if (fsList != null && !fsList.isEmpty()) {
result = fsList.get(0);
} else {
_logger.info("No file system found using the storage resource id: " + storageResourceId);
}
return result;
}
use of com.emc.storageos.vnxe.models.VNXeFileSystem in project coprhd-controller by CoprHD.
the class FileSystemListRequestTest method getTest.
@Test
public void getTest() {
FileSystemListRequest req = new FileSystemListRequest(_client);
List<VNXeFileSystem> list = req.get();
for (VNXeFileSystem fs : list) {
String id = fs.getId();
System.out.println(id);
}
VNXeFileSystem fs1 = req.getByStorageResource("res_19");
System.out.println(fs1.getName());
/*
* VNXeFileSystem fs2 = req.getByFSName("ProviderTenant_fskh02_5bb3ac40-65f3-4ce1-b629-0c2f0775647c");
* System.out.println(fs2.getId());
*/
}
Aggregations