Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.
openapi: 3.2.0
info:
contact:
email: info@portainer.io
description: Portainer API is an HTTP API served by Portainer.
license:
name: zlib
url: https://github.com/portainer/portainer/blob/develop/LICENSE
title: PortainerCE WebSocket API
version: 2.39.1
servers:
- url: /api
tags:
- description: Create exec sessions using websockets
name: Websocket
paths:
/websocket/attach:
get:
description: 'If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint).
If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and
an AttachStart operation HTTP request will be created and hijacked.
**Access policy**: authenticated'
parameters:
- description: environment(endpoint) ID of the environment(endpoint) where the resource is located
in: query
name: endpointId
required: true
schema:
type: integer
- description: node name
in: query
name: nodeName
schema:
type: string
- description: JWT token used for authentication against this environment(endpoint)
in: query
name: token
required: true
schema:
type: string
responses:
'200':
description: OK
'400':
description: Bad Request
'403':
description: Forbidden
'404':
description: Not Found
'500':
description: Internal Server Error
security:
- ApiKeyAuth: []
- jwt: []
summary: Attach a websocket
tags:
- Websocket
operationId: getWebsocketAttach
x-operation-id-source: derived
/websocket/exec:
get:
description: 'If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint).
If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and
an ExecStart operation HTTP request will be created and hijacked.'
parameters:
- description: environment(endpoint) ID of the environment(endpoint) where the resource is located
in: query
name: endpointId
required: true
schema:
type: integer
- description: node name
in: query
name: nodeName
schema:
type: string
- description: JWT token used for authentication against this environment(endpoint)
in: query
name: token
required: true
schema:
type: string
responses:
'200':
description: OK
'400':
description: Bad Request
'409':
description: Conflict
'500':
description: Internal Server Error
security:
- ApiKeyAuth: []
- jwt: []
summary: Execute a websocket
tags:
- Websocket
operationId: getWebsocketExec
x-operation-id-source: derived
/websocket/kubernetes-shell:
get:
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.
**Access policy**: authenticated'
parameters:
- description: environment(endpoint) ID of the environment(endpoint) where the resource is located
in: query
name: endpointId
required: true
schema:
type: integer
- description: JWT token used for authentication against this environment(endpoint)
in: query
name: token
required: true
schema:
type: string
responses:
'200':
description: Success
'400':
description: Invalid request
'403':
description: Permission denied
'500':
description: Server error
security:
- ApiKeyAuth: []
- jwt: []
summary: Execute a websocket on kubectl shell pod
tags:
- Websocket
operationId: getWebsocketKubernetesShell
x-operation-id-source: derived
/websocket/pod:
get:
description: 'The request will be upgraded to the websocket protocol.
**Access policy**: authenticated'
parameters:
- description: environment(endpoint) ID of the environment(endpoint) where the resource is located
in: query
name: endpointId
required: true
schema:
type: integer
- description: namespace where the container is located
in: query
name: namespace
required: true
schema:
type: string
- description: name of the pod containing the container
in: query
name: podName
required: true
schema:
type: string
- description: name of the container
in: query
name: containerName
required: true
schema:
type: string
- description: command to execute in the container
in: query
name: command
required: true
schema:
type: string
- description: JWT token used for authentication against this environment(endpoint)
in: query
name: token
required: true
schema:
type: string
responses:
'200':
description: OK
'400':
description: Bad Request
'403':
description: Forbidden
'404':
description: Not Found
'500':
description: Internal Server Error
security:
- ApiKeyAuth: []
- jwt: []
summary: Execute a websocket on pod
tags:
- Websocket
operationId: getWebsocketPod
x-operation-id-source: derived
components:
securitySchemes:
ApiKeyAuth:
in: header
name: X-API-KEY
type: apiKey
jwt:
in: header
name: Authorization
type: apiKey