@@ -41,54 +41,47 @@ type health struct {
41
41
}
42
42
43
43
func (h * health ) HealthCheck (moduleName string ) (healthy bool , err error ) {
44
- var name string
44
+
45
45
switch moduleName {
46
46
case types .CC_MODULE_AUDITCONTROLLER :
47
47
h .capability .Discover = h .disc .AuditCtrl ()
48
- name = "audit"
49
48
50
49
case types .CC_MODULE_HOSTCONTROLLER :
51
50
h .capability .Discover = h .disc .HostCtrl ()
52
- name = "host"
53
51
54
52
case types .CC_MODULE_OBJECTCONTROLLER :
55
53
h .capability .Discover = h .disc .ObjectCtrl ()
56
- name = "object"
57
54
58
55
case types .CC_MODULE_PROCCONTROLLER :
59
56
h .capability .Discover = h .disc .ProcCtrl ()
60
- name = "process"
61
57
62
58
case types .CC_MODULE_DATACOLLECTION :
63
59
h .capability .Discover = h .disc .DataCollect ()
64
- name = "collector"
65
60
66
61
case types .CC_MODULE_HOST :
67
62
h .capability .Discover = h .disc .HostServer ()
68
- name = "host"
69
63
70
64
case types .CC_MODULE_MIGRATE :
71
65
h .capability .Discover = h .disc .MigrateServer ()
72
- name = "migrate"
73
66
74
67
case types .CC_MODULE_PROC :
75
68
h .capability .Discover = h .disc .ProcServer ()
76
- name = "process"
77
69
78
70
case types .CC_MODULE_TOPO :
79
71
h .capability .Discover = h .disc .TopoServer ()
80
- name = "topo"
81
72
82
73
case types .CC_MODULE_EVENTSERVER :
83
74
h .capability .Discover = h .disc .EventServer ()
84
- name = "event"
75
+
76
+ case types .CC_MODULE_APISERVER :
77
+ h .capability .Discover = h .disc .ApiServer ()
85
78
86
79
default :
87
80
return false , fmt .Errorf ("unsupported health module: %s" , moduleName )
88
81
}
89
82
90
83
resp := new (metric.HealthResponse )
91
- client := rest .NewRESTClient (h .capability , fmt . Sprintf ( "/%s/v3" , name ) )
84
+ client := rest .NewRESTClient (h .capability , "/" )
92
85
err = client .Get ().
93
86
WithContext (context .Background ()).
94
87
SubResource ("/healthz" ).
0 commit comments