mirror of https://github.com/portainer/portainer
added swagger docs to websocketShellPodExec (#5840)
parent
661931d8b0
commit
dad762de9f
|
@ -10,13 +10,21 @@ import (
|
||||||
"github.com/portainer/portainer/api/http/security"
|
"github.com/portainer/portainer/api/http/security"
|
||||||
)
|
)
|
||||||
|
|
||||||
// websocketShellPodExec handles GET requests on /websocket/pod?token=<token>&endpointId=<endpointID>
|
// @summary Execute a websocket on kubectl shell pod
|
||||||
// The request will be upgraded to the websocket protocol.
|
// @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.
|
||||||
// Authentication and access is controlled via the mandatory token query parameter.
|
// @description **Access policy**: authenticated
|
||||||
// The request will proxy input from the client to the pod via long-lived websocket connection.
|
// @security jwt
|
||||||
// The following query parameters are mandatory:
|
// @tags websocket
|
||||||
// * token: JWT token used for authentication against this environment(endpoint)
|
// @accept json
|
||||||
// * endpointId: environment(endpoint) ID of the environment(endpoint) where the resource is located
|
// @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 {
|
func (handler *Handler) websocketShellPodExec(w http.ResponseWriter, r *http.Request) *httperror.HandlerError {
|
||||||
endpointID, err := request.RetrieveNumericQueryParameter(r, "endpointId", false)
|
endpointID, err := request.RetrieveNumericQueryParameter(r, "endpointId", false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue