use of models.datatable.FilePolicySnapshotsDataTable 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 models.datatable.FilePolicySnapshotsDataTable in project coprhd-controller by CoprHD.
the class FileSystems method listPolicySnapshotJson.
public static void listPolicySnapshotJson(String fileSystemAndpolicyId) {
renderArgs.put("dataTable", new FilePolicySnapshotsDataTable());
String fileSystemId = null;
String policyId = null;
if (StringUtils.isNotBlank(fileSystemAndpolicyId)) {
String[] parts = fileSystemAndpolicyId.split("~~~");
if (parts.length == 2) {
fileSystemId = parts[0];
policyId = parts[1];
}
}
ViPRCoreClient client = BourneUtil.getViprClient();
List<FilePolicySnapshotsDataTable.FileSnapshot> snapshotList = Lists.newArrayList();
ScheduleSnapshotList snapList = client.fileSystems().getFilePolicySnapshots(uri(fileSystemId), uri(policyId));
for (ScheduleSnapshotRestRep snap : snapList.getScheduleSnapList()) {
snapshotList.add(new FilePolicySnapshotsDataTable.FileSnapshot(snap));
}
renderJSON(DataTablesSupport.createJSON(snapshotList, params));
}
Aggregations