Pch5SwitchCtrl.java
3.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package com.ui.ctrl;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.HashMap;
import java.util.Map;
/**
* pch5切换
*
* @author craig.qin 2018-3-6
*/
@Controller
@RequestMapping("/pch5Switch")
public class Pch5SwitchCtrl {
@Autowired
HttpRestClient httpRestClient;
@RequestMapping(value = "/toDockerPch5Switch")
public ModelAndView toDockerPch5Switch() {
ModelAndView mdv = new ModelAndView("pch5Switch/pch5DockerSwitch");
return mdv;
}
/**
* 解析当前配置,绘图用
*
*/
@RequestMapping(value = "/getDockerElbStatus")
@ResponseBody
public BaseResponse getDockerElbStatus() {
return httpRestClient.defaultGet( "/pch5DockerSwitch/getDockerElbStatus", BaseResponse.class, null);
}
/**
* az2切换
* 直接修改权限
*/
@RequestMapping(value = "/switchDockerAz2",method = RequestMethod.POST)
@ResponseBody
public BaseResponse switchDockerAz2(String projectType,String onlineOrGray) {
Map<String, String> map=new HashMap<>();
map.put("projectType",projectType);
map.put("onlineOrGray",onlineOrGray);
return httpRestClient.defaultGet( "/pch5DockerSwitch/switchDockerAz2", BaseResponse.class, map);
}
/***********************************************************************************************************
* 以下内容为原来的pch5切换,以上部分为docker pch5切换
*********************************************************************************************************/
@RequestMapping(value = "/toPch5Switch")
public ModelAndView toPch5Switch() {
ModelAndView mdv = new ModelAndView("pch5Switch/pch5switch");
return mdv;
}
/**
* 解析当前配置,绘图用
*
*/
@RequestMapping(value = "/getElbStatus")
@ResponseBody
public BaseResponse getElbStatus() {
return httpRestClient.defaultGet( "/pch5Switch/getElbStatus", BaseResponse.class, null);
}
/**
* 可用区切换
*
*/
@RequestMapping(value = "/switchArea",method = RequestMethod.POST)
@ResponseBody
public BaseResponse switchArea(String area) {
return httpRestClient.defaultGet( "/pch5Switch/switchArea?area="+area, BaseResponse.class, null);
}
/**
* az2切换
*
*/
@RequestMapping(value = "/switchAz2",method = RequestMethod.POST)
@ResponseBody
public BaseResponse switchAz2(String onlineOrGray) {
return httpRestClient.defaultGet( "/pch5Switch/switchAz2?onlineOrGray="+onlineOrGray, BaseResponse.class, null);
}
/**
* az2-node host文件查询
*
*/
@RequestMapping(value = "/getAz2NodeHosts")
@ResponseBody
public BaseResponse getAz2NodeHosts() {
return httpRestClient.defaultGet( "/pch5Switch/getAz2NodeHosts", BaseResponse.class);
}
/**
* 最近发布记录(success)
*
*/
@RequestMapping(value = "/getAzProjectLatestReleaseHistory")
@ResponseBody
public BaseResponse getAzProjectLatestReleaseHistory() {
return httpRestClient.defaultGet( "/pch5Switch/getAzProjectLatestReleaseHistory", BaseResponse.class);
}
}