use of com.ctrip.framework.apollo.common.dto.ClusterDTO in project apollo by ctripcorp.
the class ConfigsExportServiceTest method genCluster.
private ClusterDTO genCluster(String name, String appId) {
ClusterDTO clusterDTO = new ClusterDTO();
clusterDTO.setAppId(appId);
clusterDTO.setName(name);
return clusterDTO;
}
use of com.ctrip.framework.apollo.common.dto.ClusterDTO in project apollo by ctripcorp.
the class ClusterService method createCluster.
public ClusterDTO createCluster(Env env, ClusterDTO cluster) {
if (!clusterAPI.isClusterUnique(cluster.getAppId(), env, cluster.getName())) {
throw new BadRequestException(String.format("cluster %s already exists.", cluster.getName()));
}
ClusterDTO clusterDTO = clusterAPI.create(env, cluster);
Tracer.logEvent(TracerEventType.CREATE_CLUSTER, cluster.getAppId(), "0", cluster.getName());
return clusterDTO;
}
Aggregations