Search in sources :

Example 1 with ListProjectRequest

use of com.aliyun.openservices.log.request.ListProjectRequest 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();
}
Also used : ListProjectRequest(com.aliyun.openservices.log.request.ListProjectRequest) Client(com.aliyun.openservices.log.Client) LogException(com.aliyun.openservices.log.exception.LogException)

Aggregations

Client (com.aliyun.openservices.log.Client)1 LogException (com.aliyun.openservices.log.exception.LogException)1 ListProjectRequest (com.aliyun.openservices.log.request.ListProjectRequest)1