use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileSystems method getVarrayVpool.
public static void getVarrayVpool(String resourceId) {
HashMap<String, String> response = new HashMap<String, String>();
URI fileShareId = uri(resourceId);
ViPRCoreClient client = BourneUtil.getViprClient();
FileShareRestRep fileShare = client.fileSystems().get(fileShareId);
URI vArray = fileShare.getVirtualArray().getId();
URI vPool = fileShare.getVirtualPool().getId();
response.put("vArray", client.varrays().get(vArray).getName());
response.put("vPool", client.fileVpools().get(vPool).getName());
renderJSON(response);
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileSystems method editAce.
/**
* This method called When user clicks ACE hyper-link to modify.
*
* @param id
* Access control entry.
*/
public static void editAce(@Required String id) {
String type = ShareACLForm.extractTypeFromId(id);
String name = ShareACLForm.extractNameFromId(id);
String domain = ShareACLForm.extractDomainFromId(id);
String fileSystem = ShareACLForm.extractFileSystemFromId(id);
String shareName = ShareACLForm.extractShareNameFromId(id);
String permission = ShareACLForm.extractPermissionFromId(id);
if ("null".equals(domain)) {
domain = "";
}
ShareACLForm shareACL = new ShareACLForm();
shareACL.type = type;
shareACL.name = name;
shareACL.domain = domain;
shareACL.permission = permission;
renderArgs.put("permissionOptions", StringOption.options(new String[] { "Read", "Change", "FullControl" }));
renderArgs.put("fileSystemId", uri(fileSystem));
ViPRCoreClient client = BourneUtil.getViprClient();
FileShareRestRep restRep = client.fileSystems().get(uri(fileSystem));
renderArgs.put("fileSystemName", restRep.getName());
renderArgs.put("shareName", shareName);
renderArgs.put("TYPE", type.toUpperCase());
render(shareACL);
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileSystems method deleteFileSystem.
@FlashException(referrer = { "fileSystem" })
public static void deleteFileSystem(String fileSystemId, String deleteType) {
if (StringUtils.isNotBlank(fileSystemId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
boolean forceDelete = false;
Task<FileShareRestRep> task = client.fileSystems().deactivate(uri(fileSystemId), new FileSystemDeleteParam(forceDelete, deleteType));
flash.put("info", MessagesUtils.get("resources.filesystem.deactivate"));
}
fileSystem(fileSystemId);
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileSystems method editNfsAce.
public static void editNfsAce(@Required String id) {
String type = NfsACLForm.extractTypeFromId(id);
String name = NfsACLForm.extractNameFromId(id);
String domain = NfsACLForm.extractDomainFromId(id);
String fileSystem = NfsACLForm.extractFileSystemFromId(id);
String subDir = NfsACLForm.extractSubDirFromId(id);
String permissions = NfsACLForm.extractPermissionsFromId(id);
String permissionType = NfsACLForm.extractPermissionTypeFromId(id);
String fsMountPath = NfsACLForm.extractMounPathFromId(id);
if ("null".equals(domain)) {
domain = "";
}
NfsACLForm nfsACL = new NfsACLForm();
nfsACL.type = type.toUpperCase();
nfsACL.name = name;
nfsACL.domain = domain;
String[] strPerm = permissions.replaceAll("/", ",").split(",");
nfsACL.permissions = new HashSet<String>(Arrays.asList(strPerm));
nfsACL.permissionType = permissionType;
renderArgs.put("permissionOptions", StringOption.options(new String[] { "read", "write", "execute", "fullControl" }));
renderArgs.put("permissionTypeOptions", StringOption.options(new String[] { "allow", "deny" }));
renderArgs.put("fileSystemId", uri(fileSystem));
ViPRCoreClient client = BourneUtil.getViprClient();
FileShareRestRep restRep = client.fileSystems().get(uri(fileSystem));
renderArgs.put("fileSystemName", restRep.getName());
renderArgs.put("subDir", subDir);
renderArgs.put("fsMountPath", fsMountPath);
renderArgs.put("TYPE", type.toUpperCase());
render(nfsACL);
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileSystems method deleteFileSystemExport.
@FlashException(referrer = { "fileSystem" })
public static void deleteFileSystemExport(String fileSystemId, String security, String exportPath) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportRule rule = new ExportRule();
rule.setSecFlavor(security);
List<ExportRule> list = Lists.newArrayList();
list.add(rule);
ExportRules exportRules = new ExportRules();
exportRules.setExportRules(list);
FileShareExportUpdateParams params = new FileShareExportUpdateParams();
params.setExportRulesToDelete(exportRules);
FileShareRestRep fileSystem = client.fileSystems().get(uri(fileSystemId));
String subDir = FileUtils.findSubDirectory(fileSystem.getMountPath(), exportPath);
client.fileSystems().updateExport(uri(fileSystemId), subDir, params);
flash.put("info", MessagesUtils.get("resources.filesystem.export.deactivate"));
fileSystem(fileSystemId);
}
Aggregations