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