Search in sources :

Example 1 with RebootNodeJob

use of jobs.RebootNodeJob in project coprhd-controller by CoprHD.

the class SystemHealth method nodeReboot.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void nodeReboot(@Required String nodeId) {
    NodeHealth nodeHealth = MonitorUtils.getNodeHealth(nodeId);
    String node = nodeId;
    try {
        node = MonitorUtils.getNodeHealth(nodeId).getNodeName();
    } catch (NullPointerException e) {
        Logger.warn("Could not determine node name.");
    }
    if (nodeHealth != null && nodeHealth.getStatus().equals("Good")) {
        new RebootNodeJob(getSysClient(), nodeId).in(3);
        flash.success(Messages.get("adminDashboard.nodeRebooting", node));
        Maintenance.maintenance(Common.reverseRoute(SystemHealth.class, "systemHealth"));
    } else {
        flash.error(Messages.get("systemHealth.message.reboot.unavailable", node));
        systemHealth();
    }
}
Also used : RebootNodeJob(jobs.RebootNodeJob) NodeHealth(com.emc.vipr.model.sys.healthmonitor.NodeHealth) Restrictions(controllers.deadbolt.Restrictions)

Example 2 with RebootNodeJob

use of jobs.RebootNodeJob in project coprhd-controller by CoprHD.

the class AdminDashboard method nodeReboot.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void nodeReboot(@Required String nodeId) {
    new RebootNodeJob(getSysClient(), nodeId).in(3);
    flash.success(Messages.get("adminDashboard.nodeRebooting", nodeId));
    Maintenance.maintenance(Common.reverseRoute(AdminDashboard.class, "dashboard"));
}
Also used : RebootNodeJob(jobs.RebootNodeJob) Restrictions(controllers.deadbolt.Restrictions)

Aggregations

Restrictions (controllers.deadbolt.Restrictions)2 RebootNodeJob (jobs.RebootNodeJob)2 NodeHealth (com.emc.vipr.model.sys.healthmonitor.NodeHealth)1