use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class FileSnapshotService method getFileSystemSnapshotExportList.
/**
* @Deprecated use {id}/export instead
* Get file share snapshots exports
* @param id
* the URN of a ViPR Snapshot
* @brief List file snapshot exports.This method is deprecated.
* <p>
* Use /file/snapshots/{id}/export instead.
* @return List of file share snapshot exports
*/
@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 getFileSystemSnapshotExportList(@PathParam("id") URI id) {
ArgValidator.checkFieldUriType(id, Snapshot.class, "id");
Snapshot snapshot = queryResource(id);
FileSystemExportList fileExportListResponse = new FileSystemExportList();
if (snapshot.getInactive()) {
return fileExportListResponse;
}
// Get export map from snapshot
FSExportMap exportMap = snapshot.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());
fileExportListResponse.getExportList().add(fileExportParam);
}
return fileExportListResponse;
}
use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class FileStorageUtils method getExport.
public static FileSystemExportParam getExport(URI fileSystemId, String protocol, String security, String permissions, String rootUser) {
List<FileSystemExportParam> exports = execute(new GetNfsExportsForFileSystem(fileSystemId));
for (FileSystemExportParam export : exports) {
boolean protocolMatch = StringUtils.equals(export.getProtocol(), protocol);
boolean securityMatch = StringUtils.equals(export.getSecurityType(), security);
boolean permissionMatch = StringUtils.equals(export.getPermissions(), permissions);
boolean rootUserMatch = StringUtils.equals(export.getRootUserMapping(), rootUser);
if (protocolMatch && securityMatch && permissionMatch && rootUserMatch) {
return export;
}
}
return null;
}
use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class CreateFileSnapshotExport method doExecute.
@Override
protected Task<FileSnapshotRestRep> doExecute() throws Exception {
FileSystemExportParam export = new FileSystemExportParam();
export.setProtocol(protocol);
export.setSecurityType(security);
export.setPermissions(permissions);
export.setRootUserMapping(user);
export.getEndpoints().addAll(hosts);
if (StringUtils.isNotBlank(comment)) {
export.setComments(comment);
}
if (StringUtils.isNotBlank(subDirectory)) {
export.setSubDirectory(subDirectory);
}
return getClient().fileSnapshots().export(fileSnapshotId, export);
}
use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class FileSystems method fileSystemExports.
public static void fileSystemExports(String fileSystemId) {
URI id = uri(fileSystemId);
List<ExportRule> exports = FileUtils.getFSExportRules(id);
List<FileSystemExportParam> exportsParam = FileUtils.getExports(id);
renderArgs.put("permissionTypeOptions", Lists.newArrayList(FileShareExport.Permissions.values()));
render(exports, exportsParam);
}
use of com.emc.storageos.model.file.FileSystemExportParam in project coprhd-controller by CoprHD.
the class FileProvider method getNFSFileExports.
@Asset("fileExports")
@AssetDependencies("fileNFSFilesystem")
public List<AssetOption> getNFSFileExports(AssetOptionsContext ctx, URI fileFilesystem) {
List<AssetOption> options = Lists.newArrayList();
for (FileSystemExportParam export : listFileExports(ctx, fileFilesystem)) {
options.add(new AssetOption(export.getMountPoint(), export.getMountPoint()));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
Aggregations