---
title: "连接到Pod终端"
method: GET
path: "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/terminal"
tags: ["K8s容器终端"]
---

# 连接到Pod终端

`GET /k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/terminal`

通过WebSocket连接到指定Pod的终端

## Path parameters

- `id` integer, required
- `namespaceName` string, required
- `podName` string, required

## Query parameters

- `containerName` string
- `command` string

## Headers

- `Authorization` string, required

## Other responses

- `101` — Switching Protocols
- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.dev/opsre/apis/devops.md) · [All operations](https://skmtc.dev/opsre/apis/devops/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/opsre/devops/revisions/25cac8835c4c/schema)
