---
title: "获取Pod中的容器列表"
method: GET
path: "/k8s/cluster/{id}/namespaces/{namespaceName}/pods/{podName}/containers"
tags: ["K8s容器终端"]
---

# 获取Pod中的容器列表

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

获取指定Pod中所有容器的名称列表，用于终端连接时选择容器

## Path parameters

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

## Headers

- `Authorization` string, required

## Response `200`

OK

- object
  - `code` integer — 状态码
  - `data` string[] — 返回的数据
  - `message` string — 提示信息

## Other responses

- `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)
