use of com.emc.storageos.model.file.FileSystemExportList 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.FileSystemExportList in project coprhd-controller by CoprHD.
the class InternalFileServiceClient method getFileSystemExportList.
/**
* Get list of exports for this file system
*
* @param fsId file share ID
* @return
*/
public FileSystemExportList getFileSystemExportList(URI fsId) {
WebResource rRoot = createRequest(INTERNAL_FILE_ROOT + fsId + EXPORTS);
FileSystemExportList resp = addSignature(rRoot).get(FileSystemExportList.class);
return resp;
}
use of com.emc.storageos.model.file.FileSystemExportList 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;
}
Aggregations