Search in sources :

Example 1 with ListLogStoresRequest

use of com.aliyun.openservices.log.request.ListLogStoresRequest 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();
}
Also used : ListLogStoresRequest(com.aliyun.openservices.log.request.ListLogStoresRequest) 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 ListLogStoresRequest (com.aliyun.openservices.log.request.ListLogStoresRequest)1