Search in sources :

Example 1 with DbConsistencyStatusRestRep

use of com.emc.storageos.model.db.DbConsistencyStatusRestRep in project coprhd-controller by CoprHD.

the class DbConsistencyService method toStatusRestRep.

private DbConsistencyStatusRestRep toStatusRestRep(DbConsistencyStatus status) {
    DbConsistencyStatusRestRep statusRestRep = new DbConsistencyStatusRestRep();
    if (status != null) {
        statusRestRep.setStatus(status.getStatus());
        statusRestRep.setStartTime(status.getStartTime());
        statusRestRep.setEndTime(status.getEndTime());
        statusRestRep.setProgress(status.getProgress());
        statusRestRep.setWorkingPoint(status.getWorkingPoint());
    } else {
        statusRestRep.setStatus(DbConsistencyStatusRestRep.Status.NOT_STARTED);
    }
    return statusRestRep;
}
Also used : DbConsistencyStatusRestRep(com.emc.storageos.model.db.DbConsistencyStatusRestRep)

Example 2 with DbConsistencyStatusRestRep

use of com.emc.storageos.model.db.DbConsistencyStatusRestRep in project coprhd-controller by CoprHD.

the class Upgrade method clusterStatus.

public static void clusterStatus() {
    ClusterInfo clusterInfo = getSysClient().upgrade().getClusterInfo();
    Collection<String> repositoryVersions = clusterInfo.getTargetState().getAvailable();
    Collection<String> newVersions = clusterInfo.getNewVersions() == null ? Collections.<String>emptyList() : clusterInfo.getNewVersions();
    String clusterState = calculateClusterState(clusterInfo);
    boolean isStable = clusterState.equalsIgnoreCase(ClusterInfo.ClusterState.STABLE.toString());
    boolean isWorking = !isStable && !clusterState.equalsIgnoreCase(ClusterInfo.ClusterState.UNKNOWN.toString());
    boolean isDownloading = clusterState.equals(DOWNLOADING_CLUSTER_STATE) || isStandbySiteDownloading();
    DbConsistencyStatusRestRep checkDbState = getSysClient().upgrade().getDbCheckState();
    String isDbCheckStatus = checkDbState.getStatus().toString();
    int checkProgress = checkDbState.getProgress();
    Map<String, Map<String, DownloadStatus>> downloadStatus = Maps.newLinkedHashMap();
    if (isDownloading) {
        SiteRestRep activeSite = DisasterRecoveryUtils.getActiveSite();
        DownloadProgress downloadProgress = getSysClient().upgrade().getDownloadProgress();
        downloadStatus.put(activeSite.getName(), calculateDownloadStatus(downloadProgress));
        for (SiteRestRep standby : DisasterRecoveryUtils.getStandbySites()) {
            downloadProgress = getSysClient().upgrade().getDownloadProgress(standby.getUuid());
            downloadStatus.put(standby.getName(), calculateDownloadStatus(downloadProgress));
        }
    }
    render(clusterInfo, clusterState, newVersions, repositoryVersions, isStable, isWorking, isDownloading, downloadStatus, checkProgress, isDbCheckStatus);
}
Also used : DbConsistencyStatusRestRep(com.emc.storageos.model.db.DbConsistencyStatusRestRep) ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) SiteRestRep(com.emc.storageos.model.dr.SiteRestRep) DownloadProgress(com.emc.vipr.model.sys.DownloadProgress) Map(java.util.Map)

Example 3 with DbConsistencyStatusRestRep

use of com.emc.storageos.model.db.DbConsistencyStatusRestRep in project coprhd-controller by CoprHD.

the class Upgrade method checkDbProgress.

public static void checkDbProgress() {
    DbConsistencyStatusRestRep dbState = getSysClient().upgrade().getDbCheckState();
    renderJSON(dbState);
}
Also used : DbConsistencyStatusRestRep(com.emc.storageos.model.db.DbConsistencyStatusRestRep)

Aggregations

DbConsistencyStatusRestRep (com.emc.storageos.model.db.DbConsistencyStatusRestRep)3 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)1 ClusterInfo (com.emc.vipr.model.sys.ClusterInfo)1 DownloadProgress (com.emc.vipr.model.sys.DownloadProgress)1 Map (java.util.Map)1