Search in sources :

Example 1 with GetAllClusterResponse

use of com.webank.wedatasphere.qualitis.response.GetAllClusterResponse in project Qualitis by WeBankFinTech.

the class MetaDataServiceImpl method getUserCluster.

@Override
public GeneralResponse<GetAllClusterResponse<ClusterInfoDetail>> getUserCluster(GetUserClusterRequest request) throws UnExpectedRequestException, MetaDataAcquireFailedException {
    // Check Arguments
    checkRequest(request);
    // Get login user
    String userName = HttpUtils.getUserName(httpServletRequest);
    GetClusterByUserRequest getClusterByUserRequest = new GetClusterByUserRequest(userName, request.getStartIndex(), request.getPageSize());
    DataInfo<ClusterInfoDetail> response = metaDataClient.getClusterByUser(getClusterByUserRequest);
    GetAllClusterResponse<ClusterInfoDetail> result = new GetAllClusterResponse<>();
    result.setOptionalClusters(ruleLimitationService.getLimitClusters());
    result.setTotal(response.getTotalCount());
    result.setData(response.getContent());
    LOGGER.info("Succeed to get cluster. response: {}", result);
    return new GeneralResponse<>("200", "{&GET_CLUSTER_SUCCESSFULLY}", result);
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) ClusterInfoDetail(com.webank.wedatasphere.qualitis.metadata.response.cluster.ClusterInfoDetail) GetClusterByUserRequest(com.webank.wedatasphere.qualitis.metadata.request.GetClusterByUserRequest) GetAllClusterResponse(com.webank.wedatasphere.qualitis.response.GetAllClusterResponse)

Aggregations

GetClusterByUserRequest (com.webank.wedatasphere.qualitis.metadata.request.GetClusterByUserRequest)1 ClusterInfoDetail (com.webank.wedatasphere.qualitis.metadata.response.cluster.ClusterInfoDetail)1 GeneralResponse (com.webank.wedatasphere.qualitis.response.GeneralResponse)1 GetAllClusterResponse (com.webank.wedatasphere.qualitis.response.GetAllClusterResponse)1