Search in sources :

Example 1 with FilePolicySnapshotsDataTable

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();
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) FilePolicySnapshotsDataTable(models.datatable.FilePolicySnapshotsDataTable)

Example 2 with FilePolicySnapshotsDataTable

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));
}
Also used : ScheduleSnapshotList(com.emc.storageos.model.file.ScheduleSnapshotList) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FilePolicySnapshotsDataTable(models.datatable.FilePolicySnapshotsDataTable) ScheduleSnapshotRestRep(com.emc.storageos.model.file.ScheduleSnapshotRestRep)

Aggregations

ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)2 FilePolicySnapshotsDataTable (models.datatable.FilePolicySnapshotsDataTable)2 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)1 ScheduleSnapshotList (com.emc.storageos.model.file.ScheduleSnapshotList)1 ScheduleSnapshotRestRep (com.emc.storageos.model.file.ScheduleSnapshotRestRep)1