tubemq-manager/src/main/java/org/apache/tubemq/manager/controller/cluster/ClusterController.java
/**
     * modify cluster info, need to check token and
     * make sure user has authorization to modify it.
     */
modify cluster info, need to check token and
make sure user has authorization to modify it.
modify cluster info need to check token and make sure user has authorization to modify it .
@RequestMapping(value = "/modify", method = RequestMethod.POST,
            produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody String modifyClusterInfo(
            @RequestBody Map<String, String> requestBody) throws Exception {
        String token = requestBody.get("confModAuthToken");
        log.info("token is {}, request body size is {}", token, requestBody.keySet());
        int clusterId = Integer.parseInt(requestBody.get("clusterId"));
        if (StringUtils.isNotBlank(token)) {
            requestBody.remove("clusterId");
            NodeEntry nodeEntry = nodeRepository.findNodeEntryByClusterIdIsAndMasterIsTrue(
                    clusterId);
            String url = SCHEMA + nodeEntry.getIp() + ":" + nodeEntry.getWebPort()
                    + "/" + TUBE_REQUEST_PATH + "?" + covertMapToQueryString(requestBody);
            return queryMaster(url);
        } else {
            TubeResult result = new TubeResult();
            result.setErrCode(-1);
            result.setResult(false);
            result.setErrMsg("token is not correct");
            return gson.toJson(result);
        }
    }
@ RequestMapping ( value = "/modify" , method = RequestMethod . POST , produces = MediaType . APPLICATION_JSON_VALUE ) public @ ResponseBody String modifyClusterInfo ( @ RequestBody Map < String , String > requestBody ) throws Exception { String token = requestBody . get ( "confModAuthToken" ) ; log . info ( "token is {}, request body size is {}" , token , requestBody . keySet ( ) ) ; int clusterId = Integer . parseInt ( requestBody . get ( "clusterId" ) ) ; if ( StringUtils . isNotBlank ( token ) ) { requestBody . remove ( "clusterId" ) ; NodeEntry nodeEntry = nodeRepository . findNodeEntryByClusterIdIsAndMasterIsTrue ( clusterId ) ; String url = SCHEMA + nodeEntry . getIp ( ) + ":" + nodeEntry . getWebPort ( ) + "/" + TUBE_REQUEST_PATH + "?" + covertMapToQueryString ( requestBody ) ; return queryMaster ( url ) ; } else { TubeResult result = new TubeResult ( ) ; result . setErrCode ( - 1 ) ; result . setResult ( false ) ; result . setErrMsg ( "token is not correct" ) ; return gson . toJson ( result ) ; } }
modify cluster info, need to check token and
 make sure user has authorization to modify it.
modify cluster info need to check token and make sure user has authorization to modify it .