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));
}
Aggregations