Authored by mlge

伸缩组信息配置----测试环境默认不允许调用伸缩组信息接口

... ... @@ -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();
... ...
... ... @@ -47,4 +47,7 @@ spark.read.data.url=http://172.31.50.139:8082/malicious/
check_bigdata=true
#自动化测试
auto.task.test.url=http://qmc.yohops.com:9999/autoTask/executeFromGongDan
\ No newline at end of file
auto.task.test.url=http://qmc.yohops.com:9999/autoTask/executeFromGongDan
#获取伸缩组数据--访问aws、qcloud服务接口
auto.fetchScaling.open=true
\ No newline at end of file
... ...
... ... @@ -43,4 +43,7 @@ remove.MaliciousIp=http://uic.yohoops.org/uic/removeMaliciousIp
#spark read url
spark.read.data.url=http://172.31.50.139:8082/malicious/
check_bigdata=true
\ No newline at end of file
check_bigdata=true
#获取伸缩组数据--访问aws、qcloud服务接口
auto.fetchScaling.open=true
\ No newline at end of file
... ...
... ... @@ -46,4 +46,7 @@ spark.read.data.url=http://172.16.6.140:8088/malicious/
check_bigdata=false
auto.task.test.url=http://192.168.103.71:8075/autoTask/executeFromGongDan
\ No newline at end of file
auto.task.test.url=http://192.168.103.71:8075/autoTask/executeFromGongDan
#获取伸缩组数据--访问aws、qcloud服务接口
auto.fetchScaling.open=false
\ No newline at end of file
... ...