use of com.aliyun.openservices.log.common.MachineGroup in project opscloud4 by ixrjog.
the class AliyunLogFacadeImpl method pushLogMemberById.
@Override
public void pushLogMemberById(Integer id) {
AliyunLogMember aliyunLogMember = aliyunLogMemberService.getById(id);
if (aliyunLogMember == null)
return;
AliyunLogMemberVO.LogMember logMember = BeanCopierUtil.copyProperties(aliyunLogMember, AliyunLogMemberVO.LogMember.class);
aliyunLogMemberPacker.wrap(logMember, SimpleExtend.EXTEND);
AliyunConfig aliyunDsInstanceConfig = (AliyunConfig) getConfig(logMember.getLog().getDatasourceInstanceId());
MachineGroup machineGroup = aliyunLogMachineGroupHandler.getMachineGroup(aliyunDsInstanceConfig.getAliyun(), logMember.getLog().getProject(), logMember.getServerGroupName());
if (machineGroup == null) {
// 创建
aliyunLogMachineGroupHandler.createMachineGroup(aliyunDsInstanceConfig.getAliyun(), logMember);
} else {
// 更新
aliyunLogMachineGroupHandler.updateMachineGroup(aliyunDsInstanceConfig.getAliyun(), logMember);
}
updateAliyunLogMemberLastPushTime(aliyunLogMember);
}
use of com.aliyun.openservices.log.common.MachineGroup in project opscloud4 by ixrjog.
the class AliyunLogMachineGroupDriver method createMachineGroup.
public void createMachineGroup(AliyunConfig.Aliyun aliyun, AliyunLogMemberVO.LogMember logMember) {
MachineGroup machineGroup = new MachineGroup(logMember.getServerGroupName(), MACHINE_IDENTIFY_TYPE, logMember.getMachineList());
machineGroup.SetGroupTopic(StringUtils.isEmpty(logMember.getTopic()) ? logMember.getServerGroupName() : logMember.getTopic());
try {
Client client = buildClient(aliyun);
CreateMachineGroupRequest req = new CreateMachineGroupRequest(logMember.getLog().getProject(), machineGroup);
client.CreateMachineGroup(req);
} catch (LogException lg) {
log.error("阿里云日志服务创建MachineGroup错误! , {}", lg.GetErrorMessage());
}
}
use of com.aliyun.openservices.log.common.MachineGroup in project opscloud4 by ixrjog.
the class AliyunLogMachineGroupDriver method updateMachineGroup.
public void updateMachineGroup(AliyunConfig.Aliyun aliyun, AliyunLogMemberVO.LogMember logMember) {
MachineGroup machineGroup = new MachineGroup(logMember.getServerGroupName(), MACHINE_IDENTIFY_TYPE, logMember.getMachineList());
machineGroup.SetGroupTopic(StringUtils.isEmpty(logMember.getTopic()) ? logMember.getServerGroupName() : logMember.getTopic());
try {
Client client = buildClient(aliyun);
UpdateMachineGroupRequest req = new UpdateMachineGroupRequest(logMember.getLog().getProject(), machineGroup);
client.UpdateMachineGroup(req);
} catch (LogException lg) {
log.error("阿里云日志服务更新MachineGroup错误! , {}", lg.GetErrorMessage());
}
}
Aggregations