Search in sources :

Example 1 with LinkisConfigurationResponse

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

the class LinkisConfigurationController method getFullTree.

@GET
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public GeneralResponse<?> getFullTree(@QueryParam("cluster_name") String clusterName) throws UnExpectedRequestException {
    String userName = HttpUtils.getUserName(httpServletRequest);
    try {
        Map<String, Map> reponse = linkisConfiguration.getFullTree(clusterName, userName);
        LinkisConfigurationResponse linkisConfigurationResponse = new LinkisConfigurationResponse();
        linkisConfigurationResponse.setQueueName(reponse.get("full_tree_queue_name"));
        linkisConfigurationResponse.setQueue(reponse.get("full_tree"));
        return new GeneralResponse<>("200", "{&SUCCESS_TO_GET_STARTUP_PATAM}", reponse);
    } catch (UnExpectedRequestException e) {
        throw new UnExpectedRequestException(e.getMessage());
    } catch (Exception e) {
        LOGGER.error("Failed to , caused by: {}", e.getMessage(), e);
        return new GeneralResponse<>("500", "{&FAILED_TO_GET_STARTUP_PATAM}", null);
    }
}
Also used : GeneralResponse(com.webank.wedatasphere.qualitis.response.GeneralResponse) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) LinkisConfigurationResponse(com.webank.wedatasphere.qualitis.response.LinkisConfigurationResponse) Map(java.util.Map) UnExpectedRequestException(com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException) Produces(javax.ws.rs.Produces) Consumes(javax.ws.rs.Consumes) GET(javax.ws.rs.GET)

Aggregations

UnExpectedRequestException (com.webank.wedatasphere.qualitis.exception.UnExpectedRequestException)1 GeneralResponse (com.webank.wedatasphere.qualitis.response.GeneralResponse)1 LinkisConfigurationResponse (com.webank.wedatasphere.qualitis.response.LinkisConfigurationResponse)1 Map (java.util.Map)1 Consumes (javax.ws.rs.Consumes)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1