Search in sources :

Example 1 with AliyunConfig

use of com.baiyi.opscloud.common.datasource.AliyunConfig 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);
}
Also used : MachineGroup(com.aliyun.openservices.log.common.MachineGroup) AliyunLogMemberVO(com.baiyi.opscloud.domain.vo.datasource.aliyun.AliyunLogMemberVO) AliyunConfig(com.baiyi.opscloud.common.datasource.AliyunConfig)

Example 2 with AliyunConfig

use of com.baiyi.opscloud.common.datasource.AliyunConfig in project opscloud4 by ixrjog.

the class AssetToResourceAccessManagementConverter method wrap.

@Override
protected void wrap(AccessManagementVO.XAccessManagement xam, DatasourceConfig datasourceConfig) {
    AliyunConfig config = dsConfigHelper.build(datasourceConfig, AliyunConfig.class);
    xam.setLoginUser(Joiner.on("").join(xam.getUsername(), config.getAliyun().getAccount().getDomain()));
    xam.setLoginUrl(config.getAliyun().getAccount().getLoginUrl());
}
Also used : AliyunConfig(com.baiyi.opscloud.common.datasource.AliyunConfig)

Example 3 with AliyunConfig

use of com.baiyi.opscloud.common.datasource.AliyunConfig in project opscloud4 by ixrjog.

the class AliyunDmsTest method listUserTest.

@Test
void listUserTest() {
    AliyunConfig config = getConfig();
    try {
        List<DmsUser.User> users = AliyunDmsUserDriver.listUser(config.getAliyun());
        System.out.println(users);
    } catch (Exception e) {
    }
}
Also used : DmsUser(com.baiyi.opscloud.datasource.aliyun.dms.entity.DmsUser) AliyunConfig(com.baiyi.opscloud.common.datasource.AliyunConfig) Test(org.junit.jupiter.api.Test) BaseAliyunTest(com.baiyi.opscloud.datasource.aliyun.base.BaseAliyunTest)

Example 4 with AliyunConfig

use of com.baiyi.opscloud.common.datasource.AliyunConfig in project opscloud4 by ixrjog.

the class AliyunLogTest method listProjectTest.

@Test
void listProjectTest() {
    AliyunConfig aliyunDsInstanceConfig = (AliyunConfig) getConfig();
    List<Project> projects = aliyunLogHandler.listProject(aliyunDsInstanceConfig.getAliyun(), "");
    System.out.println(projects);
}
Also used : Project(com.aliyun.openservices.log.common.Project) AliyunConfig(com.baiyi.opscloud.common.datasource.AliyunConfig) Test(org.junit.jupiter.api.Test)

Aggregations

AliyunConfig (com.baiyi.opscloud.common.datasource.AliyunConfig)4 Test (org.junit.jupiter.api.Test)2 MachineGroup (com.aliyun.openservices.log.common.MachineGroup)1 Project (com.aliyun.openservices.log.common.Project)1 BaseAliyunTest (com.baiyi.opscloud.datasource.aliyun.base.BaseAliyunTest)1 DmsUser (com.baiyi.opscloud.datasource.aliyun.dms.entity.DmsUser)1 AliyunLogMemberVO (com.baiyi.opscloud.domain.vo.datasource.aliyun.AliyunLogMemberVO)1