use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class FileService method getFileSystemExportList.
/**
* @Deprecated use @Path("/{id}/export") instead.
* Get list of file system exports
* @param id
* the URN of a ViPR File system
* @brief List file system exports.
* <p>
* Use /file/filesystems/{id}/export instead
* @return File system exports list.
*/
@Deprecated
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/exports")
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.ANY })
public FileSystemExportList getFileSystemExportList(@PathParam("id") URI id) {
ArgValidator.checkFieldUriType(id, FileShare.class, "id");
FileShare fileShare = queryResource(id);
FileSystemExportList fileExportListResponse = new FileSystemExportList();
if (fileShare.getInactive()) {
return fileExportListResponse;
}
// Get export map from fileSystem
FSExportMap exportMap = fileShare.getFsExports();
Collection<FileExport> fileExports = new ArrayList<FileExport>();
if (exportMap != null) {
fileExports = exportMap.values();
}
// Process each export from the map and its data to exports in response list.
for (FileExport fileExport : fileExports) {
FileSystemExportParam fileExportParam = new FileSystemExportParam();
fileExportParam.setEndpoints(fileExport.getClients());
fileExportParam.setSecurityType(fileExport.getSecurityType());
fileExportParam.setPermissions(fileExport.getPermissions());
fileExportParam.setRootUserMapping(fileExport.getRootUserMapping());
fileExportParam.setProtocol(fileExport.getProtocol());
fileExportParam.setMountPoint(fileExport.getMountPoint());
fileExportParam.setSubDirectory(fileExport.getSubDirectory());
fileExportListResponse.getExportList().add(fileExportParam);
}
return fileExportListResponse;
}
use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class CreateNfsExportAndDatastoreService method execute.
@Override
public void execute() throws Exception {
URI fileSystemId = createNfsExportHelper.createNfsExport();
List<Datastore> datastores = Lists.newArrayList();
FileShareRestRep fileSystem = FileStorageUtils.getFileSystem(fileSystemId);
FileSystemExportParam export = createNfsExportHelper.getNfsExport(fileSystemId);
connectAndInitializeHost();
if (cluster != null) {
datastores.addAll(vmware.createNfsDatastore(cluster, fileSystem, export, datacenterId, datastoreName));
} else {
datastores.add(vmware.createNfsDatastore(host, fileSystem, export, datacenterId, datastoreName));
}
if (hostId != null) {
ExecutionUtils.addAffectedResource(hostId.toString());
}
for (Datastore datastore : datastores) {
vmware.setStorageIOControl(datastore, storageIOControl, true);
}
}
use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class CreateFileSystemExport method doExecute.
@Override
protected Task<FileShareRestRep> doExecute() throws Exception {
FileSystemExportParam export = new FileSystemExportParam();
export.setProtocol(protocol);
export.setSecurityType(security);
export.setPermissions(permissions);
export.setRootUserMapping(user);
export.getEndpoints().addAll(hosts);
export.setBypassDnsCheck(bypassDnsCheck);
if (StringUtils.isNotBlank(comment)) {
export.setComments(comment);
}
if (StringUtils.isNotBlank(subDirectory)) {
export.setSubDirectory(subDirectory);
}
return getClient().fileSystems().export(fileSystemId, export);
}
Aggregations