...
|
...
|
@@ -7,6 +7,7 @@ import com.yoho.ops.cmdb.qcloud.autoscaling.QcloudAutoScalingFetcher; |
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
...
|
...
|
@@ -21,6 +22,8 @@ import java.util.List; |
|
|
@RequestMapping("/autoScaling")
|
|
|
public class AutoScalingCtrl {
|
|
|
private final Logger logger = LoggerFactory.getLogger(AutoScalingCtrl.class);
|
|
|
@Value("${auto.fetchScaling.open}")
|
|
|
private boolean autoFetchOpen;
|
|
|
@Autowired
|
|
|
private AutoScalingFetcher awsFetcher;
|
|
|
@Autowired
|
...
|
...
|
@@ -34,7 +37,10 @@ public class AutoScalingCtrl { |
|
|
@RequestMapping(value = "/getAutoScaling")
|
|
|
@ResponseBody
|
|
|
public BaseResponse getAutoScaling(int cloudType){
|
|
|
BaseResponse response=null;
|
|
|
if(!autoFetchOpen){//伸缩组数据获取开关
|
|
|
return null;
|
|
|
}
|
|
|
BaseResponse response=null;
|
|
|
List<AutoScalingGroup> autoScalingGroups=null;
|
|
|
if(1==cloudType){
|
|
|
autoScalingGroups= awsFetcher.getAutoScaling();
|
...
|
...
|
|