Search in sources :

Example 1 with RestartServiceJob

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

the class SystemHealth method serviceRestart.

@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void serviceRestart(@Required String nodeId, @Required String serviceName) {
    new RestartServiceJob(getSysClient(), serviceName, nodeId).in(3);
    String node = nodeId;
    try {
        node = MonitorUtils.getNodeHealth(nodeId).getNodeName();
    } catch (NullPointerException e) {
        Logger.warn("Could not determine node name.");
    }
    flash.success(Messages.get("adminDashboard.serviceRestarting", serviceName, node));
    Maintenance.maintenance(Common.reverseRoute(SystemHealth.class, "services", "nodeId", nodeId));
}
Also used : RestartServiceJob(jobs.RestartServiceJob) Restrictions(controllers.deadbolt.Restrictions)

Aggregations

Restrictions (controllers.deadbolt.Restrictions)1 RestartServiceJob (jobs.RestartServiceJob)1