use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSystems method listPolicySnapshot.
public static void listPolicySnapshot(String fileSystemId, String policyId, String policyName) {
renderArgs.put("dataTable", new FilePolicySnapshotsDataTable());
renderArgs.put("fileSystemId", uri(fileSystemId));
renderArgs.put("policyId", uri(policyId));
ViPRCoreClient client = BourneUtil.getViprClient();
FileShareRestRep restRep = client.fileSystems().get(uri(fileSystemId));
renderArgs.put("filePolicyName", policyName);
renderArgs.put("fileSystemName", restRep.getName());
renderArgs.put("fileSystemAndpolicyId", fileSystemId + "~~~" + policyId);
render();
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSystems method getScheculePolicies.
public static void getScheculePolicies() {
ViPRCoreClient client = BourneUtil.getViprClient();
List<NamedRelatedResourceRep> filePolicies = client.fileProtectionPolicies().listFilePolicies().getFilePolicies();
List<StringOption> policyOptions = Lists.newArrayList();
for (NamedRelatedResourceRep filePolicy : filePolicies) {
FilePolicyRestRep policyRestRep = client.fileProtectionPolicies().get(filePolicy.getId());
if (policyRestRep != null && "file_system".equalsIgnoreCase(policyRestRep.getAppliedAt())) {
policyOptions.add(new StringOption(policyRestRep.getId().toString(), filePolicy.getName()));
}
}
renderJSON(policyOptions);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSystems method addSubDirAndNfsAcl.
public static void addSubDirAndNfsAcl(String formAccessControlList, String fileSystem, String subDir) {
if (formAccessControlList == null || "".equals(formAccessControlList)) {
flash.error(MessagesUtils.get("resources.filesystem.share.acl.invalid.settings"), null);
fileSystem(fileSystem);
}
FileNfsACLUpdateParams input = createNfsAclParams(formAccessControlList);
if (subDir != null && !"null".equals(subDir) && !subDir.isEmpty()) {
input.setSubDir(subDir);
}
ViPRCoreClient client = BourneUtil.getViprClient();
try {
client.fileSystems().updateNfsACL(uri(fileSystem), input);
} catch (Exception e) {
flash.error(e.getMessage(), null);
fileSystem(fileSystem);
}
flash.success(MessagesUtils.get(ADDED));
fileSystem(fileSystem);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSystems method deleteFileSystemShare.
@FlashException(referrer = { "fileSystem" })
public static void deleteFileSystemShare(String fileSystemId, String shareName) {
ViPRCoreClient client = BourneUtil.getViprClient();
Task<FileShareRestRep> task = client.fileSystems().removeShare(uri(fileSystemId), shareName);
flash.put("info", MessagesUtils.get("resources.filesystem.share.deactivate"));
fileSystem(fileSystemId);
}
use of com.emc.vipr.client.ViPRCoreClient in project coprhd-controller by CoprHD.
the class FileSystems method listAcl.
/**
* This method called when Access Control List page is loaded.
*
* @param fileSystem
* File System id of the provided File System.
* @param shareName
* Name of the file share.
*/
public static void listAcl(String fileSystem, String shareName) {
renderArgs.put("dataTable", new ShareACLDataTable());
renderArgs.put("fileSystem", uri(fileSystem));
renderArgs.put("shareName", shareName);
renderArgs.put("aclURL", "/file/filesystems/" + uri(fileSystem) + "/shares/" + shareName + "/acl");
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());
ShareACLForm shareACL = new ShareACLForm();
render(shareACL);
}
Aggregations