use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.
the class ConfigProperties method properties.
public static void properties() {
ClusterInfo clusterInfo = Common.getClusterInfoWithRoleCheck();
List<PropertyPage> pages = loadPropertyPages();
render(pages, clusterInfo);
}
use of com.emc.vipr.model.sys.ClusterInfo 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);
}
use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.
the class Upgrade method checkDbStatus.
/*
* Method to trigger Database consistency check
*/
public static void checkDbStatus() {
ClusterInfo clusterInfo = getSysClient().upgrade().getClusterInfo();
String clusterState = calculateClusterState(clusterInfo);
try {
BourneUtil.getSysClient().upgrade().triggerDbCheck();
} catch (Exception e) {
Logger.error(e, "Checking Database Consistency");
flash.error(MessagesUtils.escape(e.getMessage()));
}
render(clusterInfo, clusterState);
}
use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.
the class Upgrade method statusChanged.
/**
* Allows the UI to ping the backend so that it knows when the upgrade is complete
*/
public static void statusChanged(String currentStatus) {
ClusterInfo clusterInfo = getSysClient().upgrade().getClusterInfo();
String clusterState = calculateClusterState(clusterInfo);
// don't go back to the index page until download is complete on all sites
if (currentStatus.equals(DOWNLOADING_CLUSTER_STATE)) {
renderJSON(!clusterState.equals(currentStatus) && !isStandbySiteDownloading());
} else {
boolean statusChanged = !clusterState.equals(currentStatus);
renderJSON(statusChanged);
}
}
Aggregations