File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 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 {
5757 // If there is a valid session and user is maintainer, allows to get status details.
5858 currentConsumer := getAPIConsumer (ctx )
5959 if currentConsumer == nil || ! isMaintainer (ctx ) {
60- return service .WriteJSON (w , nil , status )
60+ mStatus := api .computeGlobalPublicStatus ()
61+ return service .WriteJSON (w , mStatus , status )
6162 }
6263
6364 mStatus := api .computeGlobalStatus (srvs )
8081 tagsService []tag.Key
8182)
8283
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+
8397// computeGlobalStatus returns global status
8498func (api * API ) computeGlobalStatus (srvs []sdk.Service ) sdk.MonitoringStatus {
8599 mStatus := sdk.MonitoringStatus {}
You can’t perform that action at this time.
0 commit comments