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();
}
Aggregations