Commit c72c813 1 parent 368caaf commit c72c813 Copy full SHA for c72c813
File tree 1 file changed +15
-1
lines changed
1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ func (api *API) statusHandler() service.Handler {
57
57
// If there is a valid session and user is maintainer, allows to get status details.
58
58
currentConsumer := getAPIConsumer (ctx )
59
59
if currentConsumer == nil || ! isMaintainer (ctx ) {
60
- return service .WriteJSON (w , nil , status )
60
+ mStatus := api .computeGlobalPublicStatus ()
61
+ return service .WriteJSON (w , mStatus , status )
61
62
}
62
63
63
64
mStatus := api .computeGlobalStatus (srvs )
80
81
tagsService []tag.Key
81
82
)
82
83
84
+ // computeGlobalPublicStatus returns global public status
85
+ func (api * API ) computeGlobalPublicStatus () sdk.MonitoringStatus {
86
+ return sdk.MonitoringStatus {
87
+ Lines : []sdk.MonitoringStatusLine {
88
+ {
89
+ Status : sdk .MonitoringStatusOK ,
90
+ Component : "Global/Maintenance" ,
91
+ Value : fmt .Sprintf ("%v" , api .Maintenance ),
92
+ },
93
+ },
94
+ }
95
+ }
96
+
83
97
// computeGlobalStatus returns global status
84
98
func (api * API ) computeGlobalStatus (srvs []sdk.Service ) sdk.MonitoringStatus {
85
99
mStatus := sdk.MonitoringStatus {}
You can’t perform that action at this time.
0 commit comments