use of com.ctrip.xpipe.redis.console.model.ConfigModel in project x-pipe by ctripcorp.
the class ChangeConfig method stopAlertSystem.
@RequestMapping(value = "/config/alert_system/stop", method = RequestMethod.POST)
public void stopAlertSystem(HttpServletRequest request, @RequestBody(required = false) ConfigModel configModel) throws DalException {
ConfigModel config = configModel(request, configModel);
configService.stopAlertSystem(config, consoleConfig.getConfigDefaultRestoreHours());
}
use of com.ctrip.xpipe.redis.console.model.ConfigModel in project x-pipe by ctripcorp.
the class ChangeConfig method stopSentinelAutoProcess.
@RequestMapping(value = "/config/sentinel_auto_process/stop", method = RequestMethod.POST)
public void stopSentinelAutoProcess(HttpServletRequest request, @RequestBody(required = false) ConfigModel configModel) throws DalException {
ConfigModel config = configModel(request, configModel);
configService.stopSentinelAutoProcess(config, consoleConfig.getConfigDefaultRestoreHours());
}
use of com.ctrip.xpipe.redis.console.model.ConfigModel in project x-pipe by ctripcorp.
the class ChangeConfig method configModel.
private ConfigModel configModel(HttpServletRequest request, ConfigModel configModel) {
String sourceIp = request.getHeader("X-FORWARDED-FOR");
if (sourceIp == null) {
sourceIp = request.getRemoteAddr();
}
ConfigModel config = new ConfigModel().setUpdateIP(sourceIp).setUpdateUser(request.getRemoteUser());
if (configModel != null && configModel.getUpdateUser() != null)
config.setUpdateUser(configModel.getUpdateUser());
return config;
}
use of com.ctrip.xpipe.redis.console.model.ConfigModel in project x-pipe by ctripcorp.
the class ChangeConfig method stopAlertSystem.
@RequestMapping(value = "/config/alert_system/stop/{hours}", method = RequestMethod.POST)
public void stopAlertSystem(HttpServletRequest request, @PathVariable int hours, @RequestBody(required = false) ConfigModel configModel) throws DalException {
ConfigModel config = configModel(request, configModel);
int defaultHours = consoleConfig.getConfigDefaultRestoreHours();
hours = hours > defaultHours || hours < 1 ? defaultHours : hours;
configService.stopAlertSystem(config, hours);
}
use of com.ctrip.xpipe.redis.console.model.ConfigModel in project x-pipe by ctripcorp.
the class ChangeConfig method startSentinelAutoProcess.
@RequestMapping(value = "/config/sentinel_auto_process/start", method = RequestMethod.POST)
public void startSentinelAutoProcess(HttpServletRequest request, @RequestBody(required = false) ConfigModel configModel) throws DalException {
ConfigModel config = configModel(request, configModel);
configService.startSentinelAutoProcess(config);
}
Aggregations