Search in sources :

Example 1 with ComponentBindDBVO

use of com.dtstack.taier.develop.vo.console.ComponentBindDBVO in project Taier by DTStack.

the class TenantController method bindingTenant.

@PostMapping(value = "/bindingTenant")
public R<Void> bindingTenant(@RequestBody ComponentBindTenantVO vo) throws Exception {
    Cluster cluster = clusterService.getCluster(vo.getClusterId());
    if (cluster == null) {
        throw new RdosDefineException(ErrorCode.CANT_NOT_FIND_CLUSTER);
    }
    if (CollectionUtils.isNotEmpty(vo.getBindDBList())) {
        for (ComponentBindDBVO bindDBVO : vo.getBindDBList()) {
            if (Objects.isNull(bindDBVO.getComponentCode())) {
                throw new RdosDefineException(String.format(ErrorCode.META_COMPONENT_NOT_EXISTS.getMsg(), EComponentType.SPARK_THRIFT.getName()));
            }
        }
    }
    tenantService.bindingTenant(vo.getTenantId(), vo.getClusterId(), vo.getQueueId(), cluster.getClusterName(), vo.getBindDBList());
    return R.empty();
}
Also used : RdosDefineException(com.dtstack.taier.common.exception.RdosDefineException) Cluster(com.dtstack.taier.dao.domain.Cluster) ComponentBindDBVO(com.dtstack.taier.develop.vo.console.ComponentBindDBVO) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

RdosDefineException (com.dtstack.taier.common.exception.RdosDefineException)1 Cluster (com.dtstack.taier.dao.domain.Cluster)1 ComponentBindDBVO (com.dtstack.taier.develop.vo.console.ComponentBindDBVO)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1