EbsManagerCtrl.java
2.68 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
package com.ui.ctrl;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.AwsEbsTask;
import com.ui.model.req.NginxSyncTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
/**
* Created by yoho on 2016/8/23.
*/
@RestController
@RequestMapping(value = "/aws")
public class EbsManagerCtrl {
@Autowired
HttpRestClient httpRestClient;
@RequestMapping("/toEbsManager")
public ModelAndView toNginxView() {
return new ModelAndView("aws/ebsManager");
}
@RequestMapping(value = "/volume/check")
public BaseResponse checkVolume(AwsEbsTask task) {
BaseResponse response = httpRestClient.defaultPost("/aws/volume/check", task, BaseResponse.class);
return response;
}
@RequestMapping(value = "/task/create")
public BaseResponse createTask(AwsEbsTask task) {
BaseResponse response = httpRestClient.defaultPost("/aws/task/create", task, BaseResponse.class);
return response;
}
@RequestMapping(value = "/task/query")
public BaseResponse modifyTask(AwsEbsTask task) {
BaseResponse response = httpRestClient.defaultPost("/aws/task/query", task, BaseResponse.class);
return response;
}
@RequestMapping(value = "/task/all")
public BaseResponse queryAllTask() {
BaseResponse response = httpRestClient.defaultGet("/aws/task/all", BaseResponse.class);
return response;
}
@RequestMapping(value = "/task/delete")
public BaseResponse deleteTask(AwsEbsTask task) {
BaseResponse response = httpRestClient.defaultPost("/aws/task/delete", task, BaseResponse.class);
return response;
}
@RequestMapping(value = "/task/stop")
public BaseResponse stopTask(AwsEbsTask task) {
BaseResponse response = httpRestClient.defaultPost("/aws/task/stop", task, BaseResponse.class);
return response;
}
@RequestMapping(value = "/task/start")
public BaseResponse startTask(AwsEbsTask task) {
BaseResponse response = httpRestClient.defaultPost("/aws/task/start", task, BaseResponse.class);
return response;
}
@RequestMapping(value = "/snapshot/check")
public BaseResponse checkSnapShot(@RequestParam String vId) {
AwsEbsTask task = new AwsEbsTask();
task.setVolumeId(vId);
BaseResponse response = httpRestClient.defaultPost("/aws/snapshot/check", task, BaseResponse.class);
return response;
}
}