use of com.aliyun.openservices.log.exception.LogException in project opscloud4 by ixrjog.
the class AliyunLogDriver method listLogstore.
/**
* 列出当前 project 下的所有日志库名称
*
* @param aliyun
* @param project
* @return
*/
public List<String> listLogstore(AliyunConfig.Aliyun aliyun, String project) {
int offset = 0;
String logStoreSubName = "";
ListLogStoresRequest req = new ListLogStoresRequest(project, offset, QUERY_SIZE, logStoreSubName);
try {
Client client = buildClient(aliyun);
return client.ListLogStores(req).GetLogStores();
} catch (LogException lg) {
log.error("阿里云日志服务查询LogStore错误! , {}", lg.GetErrorMessage());
}
return Collections.emptyList();
}
use of com.aliyun.openservices.log.exception.LogException in project opscloud4 by ixrjog.
the class AliyunLogDriver method listConfig.
public List<String> listConfig(AliyunConfig.Aliyun aliyun, String project, String logstore) {
int offset = 0;
ListConfigRequest req = new ListConfigRequest(project, offset, QUERY_SIZE);
req.SetLogstoreName(logstore);
try {
Client client = buildClient(aliyun);
return client.ListConfig(req).GetConfigs();
} catch (LogException lg) {
log.error("阿里云日志服务查询Config错误! , {}", lg.GetErrorMessage());
}
return Collections.emptyList();
}
use of com.aliyun.openservices.log.exception.LogException in project opscloud4 by ixrjog.
the class AliyunLogMachineGroupDriver method getMachineGroups.
public List<String> getMachineGroups(AliyunConfig.Aliyun aliyun, String project, String groupName) {
int offset = 0;
ListMachineGroupRequest req = new ListMachineGroupRequest(project, groupName, offset, QUERY_SIZE);
List<String> machineGroups = new ArrayList<>();
try {
Client client = buildClient(aliyun);
machineGroups = client.ListMachineGroup(req).GetMachineGroups();
} catch (LogException lg) {
log.error("阿里云日志服务查询MachineGroup错误! , {}", lg.GetErrorMessage());
}
return machineGroups;
}
use of com.aliyun.openservices.log.exception.LogException in project opscloud4 by ixrjog.
the class AliyunLogDriver method listProject.
/**
* 列出 project
*
* @param aliyun
* @param project
* @return
*/
public List<Project> listProject(AliyunConfig.Aliyun aliyun, String project) {
int offset = 0;
ListProjectRequest req = new ListProjectRequest(project, offset, QUERY_SIZE);
try {
Client client = buildClient(aliyun);
return client.ListProject(req).getProjects();
} catch (LogException lg) {
log.error("阿里云日志服务查询Project错误! , {}", lg.GetErrorMessage());
}
return Collections.emptyList();
}
use of com.aliyun.openservices.log.exception.LogException 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());
}
}
Aggregations