Pch5SwitchCtrl.java
2.23 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
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;
/**
* pch5切换
*
* @author craig.qin 2018-3-6
*/
@Controller
@RequestMapping("/pch5Switch")
public class Pch5SwitchCtrl {
@Autowired
HttpRestClient httpRestClient;
@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);
}
}