mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
* * fix api version * fix license info * fix error response schema * fix other typos & mistakes * * remove unused tag * * fix helm issues
29 lines
793 B
Go
29 lines
793 B
Go
package edgestacks
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
httperror "github.com/portainer/libhttp/error"
|
|
"github.com/portainer/libhttp/response"
|
|
)
|
|
|
|
// @id EdgeStackList
|
|
// @summary Fetches the list of EdgeStacks
|
|
// @description
|
|
// @tags edge_stacks
|
|
// @security jwt
|
|
// @accept json
|
|
// @produce json
|
|
// @success 200 {array} portainer.EdgeStack
|
|
// @failure 500
|
|
// @failure 400
|
|
// @failure 503 "Edge compute features are disabled"
|
|
// @router /edge_stacks [get]
|
|
func (handler *Handler) edgeStackList(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
|
|
edgeStacks, err := handler.DataStore.EdgeStack().EdgeStacks()
|
|
if err != nil {
|
|
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to retrieve edge stacks from the database", err}
|
|
}
|
|
|
|
return response.JSON(w, edgeStacks)
|
|
}
|