2018-06-11 13:13:19 +00:00
|
|
|
package status
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2018-09-10 10:01:38 +00:00
|
|
|
httperror "github.com/portainer/libhttp/error"
|
|
|
|
"github.com/portainer/libhttp/response"
|
2022-05-22 05:34:09 +00:00
|
|
|
portainer "github.com/portainer/portainer/api"
|
|
|
|
"github.com/portainer/portainer/api/demo"
|
2018-06-11 13:13:19 +00:00
|
|
|
)
|
|
|
|
|
2022-05-22 05:34:09 +00:00
|
|
|
type status struct {
|
|
|
|
*portainer.Status
|
|
|
|
DemoEnvironment demo.EnvironmentDetails
|
|
|
|
}
|
|
|
|
|
2021-02-23 03:21:39 +00:00
|
|
|
// @id StatusInspect
|
|
|
|
// @summary Check Portainer status
|
|
|
|
// @description Retrieve Portainer status
|
|
|
|
// @description **Access policy**: public
|
|
|
|
// @tags status
|
|
|
|
// @produce json
|
2022-05-22 05:34:09 +00:00
|
|
|
// @success 200 {object} status "Success"
|
2021-02-23 03:21:39 +00:00
|
|
|
// @router /status [get]
|
2018-06-11 13:13:19 +00:00
|
|
|
func (handler *Handler) statusInspect(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
|
2022-05-22 05:34:09 +00:00
|
|
|
return response.JSON(w, &status{
|
|
|
|
Status: handler.Status,
|
|
|
|
DemoEnvironment: handler.demoService.Details(),
|
|
|
|
})
|
2018-06-11 13:13:19 +00:00
|
|
|
}
|