|
1 |
| -package com.navercorp.pinpoint.metric.web.authorization.controller; |
| 1 | +package com.navercorp.pinpoint.metric.web.controller; |
2 | 2 |
|
3 | 3 | import com.navercorp.pinpoint.metric.web.service.SystemMetricHostExclusionService;
|
4 | 4 | import com.navercorp.pinpoint.metric.web.view.SystemMetricHostGroupInfo;
|
@@ -30,19 +30,23 @@ public SystemMetricExclusionController(SystemMetricHostExclusionService systemMe
|
30 | 30 | this.tenantProvider = tenantProvider;
|
31 | 31 | }
|
32 | 32 |
|
33 |
| - @GetMapping(value = "/hostGroup/hostGroupInfo") |
| 33 | + @GetMapping(value = "/hostGroup") |
| 34 | + public List<String> getHostGroupNameList() { |
| 35 | + String tenantId = tenantProvider.getTenantId(); |
| 36 | + return systemMetricHostExclusionService.getHostGroupNameList(tenantId); |
| 37 | + } |
| 38 | + |
| 39 | + @GetMapping(value = "/hostGroup", params = {"hostGroupName"}) |
34 | 40 | public SystemMetricHostGroupInfo getHostGroupExclusionInfo(@RequestParam("hostGroupName") String hostGroupName) {
|
35 | 41 | String tenantId = tenantProvider.getTenantId();
|
36 | 42 | return systemMetricHostExclusionService.getHostGroupInfo(tenantId, hostGroupName);
|
37 | 43 | }
|
38 | 44 |
|
39 |
| - @GetMapping(value = "/hostGroup/hostInfoList") |
40 |
| - public List<SystemMetricHostInfo> getHostExclusionInfoList( |
41 |
| - @RequestParam("hostGroupName") String hostGroupName) { |
| 45 | + @GetMapping(value = "/hostGroup/host") |
| 46 | + public List<SystemMetricHostInfo> getHostExclusionInfoList(@RequestParam("hostGroupName") String hostGroupName, |
| 47 | + @RequestParam(value = "orderBy", defaultValue = "hostName") String orderBy) { |
42 | 48 | String tenantId = tenantProvider.getTenantId();
|
43 |
| - List<SystemMetricHostInfo> result = systemMetricHostExclusionService.getHostInfoList(tenantId, hostGroupName); |
44 |
| - |
45 |
| - return result; |
| 49 | + return systemMetricHostExclusionService.getHostInfoList(tenantId, hostGroupName, orderBy); |
46 | 50 | }
|
47 | 51 |
|
48 | 52 | @PostMapping(value = "/hostGroup")
|
@@ -95,18 +99,6 @@ public String deleteHostExclusion(@RequestParam("hostGroupName") String hostGrou
|
95 | 99 | }
|
96 | 100 | }
|
97 | 101 |
|
98 |
| - @DeleteMapping(value = "/hostGroup/unusedHosts") |
99 |
| - public String deleteUnusedHostExclusions(@RequestParam("hostGroupName") String hostGroupName) { |
100 |
| - logger.debug("delete unused host exclusions - hostGroupName: [{}]", hostGroupName); |
101 |
| - String tenantId = tenantProvider.getTenantId(); |
102 |
| - try { |
103 |
| - systemMetricHostExclusionService.deleteUnusedHostExclusions(tenantId, hostGroupName); |
104 |
| - return "OK"; |
105 |
| - } catch (Exception e) { |
106 |
| - logger.error("error while deleting unused host exclusions", e); |
107 |
| - throw new ResponseStatusException(HttpStatus.INTERNAL_SERVER_ERROR, e.getMessage()); |
108 |
| - } |
109 |
| - } |
110 | 102 |
|
111 | 103 | @DeleteMapping(value = "/unusedGroups")
|
112 | 104 | public String deleteUnusedGroupExclusions() {
|
|
0 commit comments