diff --git a/api/http/handler/websocket/shell_pod.go b/api/http/handler/websocket/shell_pod.go index 3aa5c2463..4249a350d 100644 --- a/api/http/handler/websocket/shell_pod.go +++ b/api/http/handler/websocket/shell_pod.go @@ -10,13 +10,21 @@ import ( "github.com/portainer/portainer/api/http/security" ) -// websocketShellPodExec handles GET requests on /websocket/pod?token=&endpointId= -// The request will be upgraded to the websocket protocol. -// Authentication and access is controlled via the mandatory token query parameter. -// The request will proxy input from the client to the pod via long-lived websocket connection. -// The following query parameters are mandatory: -// * token: JWT token used for authentication against this environment(endpoint) -// * endpointId: environment(endpoint) ID of the environment(endpoint) where the resource is located +// @summary Execute a websocket on kubectl shell pod +// @description The request will be upgraded to the websocket protocol. The request will proxy input from the client to the pod via long-lived websocket connection. +// @description **Access policy**: authenticated +// @security jwt +// @tags websocket +// @accept json +// @produce json +// @param endpointId query int true "environment(endpoint) ID of the environment(endpoint) where the resource is located" +// @param token query string true "JWT token used for authentication against this environment(endpoint)" +// @success 200 +// @failure 400 +// @failure 403 +// @failure 404 +// @failure 500 +// @router /websocket/kubernetes-shell [get] func (handler *Handler) websocketShellPodExec(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { endpointID, err := request.RetrieveNumericQueryParameter(r, "endpointId", false) if err != nil {