use of com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO in project apollo by ctripcorp.
the class AppController method loadEnvClusterInfo.
@RequestMapping(value = "/apps/{appId}/envclusters", method = RequestMethod.GET)
public List<OpenEnvClusterDTO> loadEnvClusterInfo(@PathVariable String appId) {
List<OpenEnvClusterDTO> envClusters = new LinkedList<>();
List<Env> envs = portalSettings.getActiveEnvs();
for (Env env : envs) {
OpenEnvClusterDTO envCluster = new OpenEnvClusterDTO();
envCluster.setEnv(env.name());
List<ClusterDTO> clusterDTOs = clusterService.findClusters(env, appId);
envCluster.setClusters(BeanUtils.toPropertySet("name", clusterDTOs));
envClusters.add(envCluster);
}
return envClusters;
}
use of com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO in project apollo by ctripcorp.
the class ServerAppOpenApiService method getEnvClusterInfo.
@Override
public List<OpenEnvClusterDTO> getEnvClusterInfo(String appId) {
List<OpenEnvClusterDTO> envClusters = new LinkedList<>();
List<Env> envs = portalSettings.getActiveEnvs();
for (Env env : envs) {
OpenEnvClusterDTO envCluster = new OpenEnvClusterDTO();
envCluster.setEnv(env.getName());
List<ClusterDTO> clusterDTOs = clusterService.findClusters(env, appId);
envCluster.setClusters(BeanUtils.toPropertySet("name", clusterDTOs));
envClusters.add(envCluster);
}
return envClusters;
}
Aggregations