Search in sources :

Example 1 with ClusterInfo

use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.

the class ConfigProperties method passwords.

public static void passwords() {
    ClusterInfo clusterInfo = Common.getClusterInfoWithRoleCheck();
    render(clusterInfo);
}
Also used : ClusterInfo(com.emc.vipr.model.sys.ClusterInfo)

Example 2 with ClusterInfo

use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.

the class Maintenance method maintenance.

public static void maintenance(String targetUrl) {
    ClusterInfo clusterInfo = null;
    try {
        clusterInfo = getClusterState();
    } catch (Exception e) {
        // This is not necessarily a problem. The cluster could already be down
        Common.handleExpiredToken(e);
        Logger.info(e, "Failed to get cluster state");
        clusterInfo = defaultClusterInfo(clusterInfo);
    }
    render(targetUrl, clusterInfo);
}
Also used : ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) ViPRHttpException(com.emc.vipr.client.exceptions.ViPRHttpException)

Example 3 with ClusterInfo

use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.

the class Maintenance method getClusterStateFromCoordinator.

private static ClusterInfo getClusterStateFromCoordinator() {
    if (StorageOsPlugin.isEnabled()) {
        CoordinatorClient coordinatorClient = StorageOsPlugin.getInstance().getCoordinatorClient();
        ClusterInfo.ClusterState clusterState = coordinatorClient.getControlNodesState();
        if (clusterState != null) {
            ClusterInfo clusterInfo = new ClusterInfo();
            clusterInfo.setCurrentState(clusterState.toString());
            return clusterInfo;
        }
    }
    return null;
}
Also used : ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) CoordinatorClient(com.emc.storageos.coordinator.client.service.CoordinatorClient)

Example 4 with ClusterInfo

use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.

the class SystemHealth method nodeRecoveryVapp.

public static void nodeRecoveryVapp() {
    ViPRSystemClient client = BourneUtil.getSysClient();
    RecoveryStatus recoveryStatus = client.control().getRecoveryStatus();
    if (recoveryStatus.getStartTime() != null) {
        DateTime startTime = new DateTime(recoveryStatus.getStartTime().getTime());
        renderArgs.put("startTime", startTime);
    }
    if (recoveryStatus.getEndTime() != null) {
        DateTime endTime = new DateTime(recoveryStatus.getEndTime().getTime());
        renderArgs.put("endTime", endTime);
    }
    RecoveryPrecheckStatus recoveryPrecheckStatus = client.control().getRecoveryPrecheckStatus();
    String precheckMsg = "";
    switch(recoveryPrecheckStatus.getStatus()) {
        case RECOVERY_NEEDED:
            precheckMsg = Messages.get("nodeRecovery.precheck.success", recoveryPrecheckStatus.getRecoverables().toString());
            break;
        case ALL_GOOD:
            precheckMsg = Messages.get("nodeRecovery.precheck.fail.allgood");
            break;
        case VAPP_IN_DR_OR_GEO:
            precheckMsg = Messages.get("nodeRecovery.precheck.fail.drorgeo");
            break;
        case NODE_UNREACHABLE:
            precheckMsg = Messages.get("nodeRecovery.precheck.fail.unreachable");
            break;
        case CORRUPTED_NODE_COUNT_MORE_THAN_QUORUM:
            precheckMsg = Messages.get("nodeRecovery.precheck.fail.quorum");
            break;
        case CORRUPTED_NODE_FOR_OTHER_REASON:
            precheckMsg = Messages.get("nodeRecovery.precheck.fail.other");
            break;
    }
    renderArgs.put("precheckMsg", precheckMsg);
    renderArgs.put("precheckStatus", recoveryPrecheckStatus.getStatus().name());
    String recoveringMsg = Messages.get("nodeRecovery.recovering.status", recoveryPrecheckStatus.getRecoverables().toString());
    renderArgs.put("recoveringMsg", recoveringMsg);
    ClusterInfo clusterInfo = AdminDashboardUtils.getClusterInfo();
    render(recoveryStatus, clusterInfo);
}
Also used : ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) RecoveryPrecheckStatus(com.emc.vipr.model.sys.recovery.RecoveryPrecheckStatus) RecoveryStatus(com.emc.vipr.model.sys.recovery.RecoveryStatus) DateTime(org.joda.time.DateTime)

Example 5 with ClusterInfo

use of com.emc.vipr.model.sys.ClusterInfo in project coprhd-controller by CoprHD.

the class SystemHealth method nodeRecovery.

public static void nodeRecovery() {
    ViPRSystemClient client = BourneUtil.getSysClient();
    RecoveryStatus recoveryStatus = client.control().getRecoveryStatus();
    if (recoveryStatus.getStartTime() != null) {
        DateTime startTime = new DateTime(recoveryStatus.getStartTime().getTime());
        renderArgs.put("startTime", startTime);
    }
    if (recoveryStatus.getEndTime() != null) {
        DateTime endTime = new DateTime(recoveryStatus.getEndTime().getTime());
        renderArgs.put("endTime", endTime);
    }
    ClusterInfo clusterInfo = AdminDashboardUtils.getClusterInfo();
    render(recoveryStatus, clusterInfo);
}
Also used : ViPRSystemClient(com.emc.vipr.client.ViPRSystemClient) ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) RecoveryStatus(com.emc.vipr.model.sys.recovery.RecoveryStatus) DateTime(org.joda.time.DateTime)

Aggregations

ClusterInfo (com.emc.vipr.model.sys.ClusterInfo)24 RepositoryInfo (com.emc.storageos.coordinator.client.model.RepositoryInfo)7 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)7 CoordinatorClientException (com.emc.storageos.systemservices.exceptions.CoordinatorClientException)7 IOException (java.io.IOException)7 Path (javax.ws.rs.Path)7 SoftwareVersion (com.emc.storageos.coordinator.client.model.SoftwareVersion)5 InvalidSoftwareVersionException (com.emc.storageos.coordinator.exceptions.InvalidSoftwareVersionException)5 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)5 ServiceUnavailableException (com.emc.storageos.svcs.errorhandling.resources.ServiceUnavailableException)5 LocalRepositoryException (com.emc.storageos.systemservices.exceptions.LocalRepositoryException)5 RemoteRepositoryException (com.emc.storageos.systemservices.exceptions.RemoteRepositoryException)5 ArrayList (java.util.ArrayList)4 POST (javax.ws.rs.POST)4 ViPRSystemClient (com.emc.vipr.client.ViPRSystemClient)3 RecoveryStatus (com.emc.vipr.model.sys.recovery.RecoveryStatus)3 Map (java.util.Map)3 Produces (javax.ws.rs.Produces)3 Service (com.emc.storageos.coordinator.common.Service)2 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)2