九章智算云
查询容器组列表

查询训练任务的容器组(Pods)列表,含每个容器组的状态与 web 终端连接地址。同步返回。返回的 podName 可作为查询 Pod 基本信息、资源信息与调度信息时的入参,常用于逐节点排查多机训练的运行情况。

GEThttps://api.alayanew.com/api/osm/v1/training/instance/{id}/pods

鉴权(Authorizations)

AuthorizationString必填

用户获取Authorization请求头后,通过该请求头完成身份认证。例如:Authorization: [your-auth-header]。

Path Parameters

idString必填

训练任务 ID(来自任务列表的 id)。例如:a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58。

Response

statusInteger

业务状态码,200 表示成功。

messageString

接口响应信息。例如:"OK"。

dataArray

容器组列表,每个元素对应该任务的一个 Pod。

显示 properties
podNameString

容器组名称,是查询 Pod 基本信息、资源信息与调度信息时所需的 podName。例如:"train-job-01-worker-0"。

podIpString

容器组 IP。例如:"10.233.250.123"。

statusString

状态,如 running。

reasonString

状态原因,正常时为空。

nodeNameString

所在节点名称。例如:"gpu-021"。

createdTimeString

创建时间。例如:"2026-10-13 09:35:00"。

updatedTimeString

更新时间。例如:"2026-10-13 09:36:10"。

podWebSSHString

web 终端连接地址,支持通过浏览器直接进入容器进行调试。若终端服务未开通,该字段返回为空。例如:"wss://console.example.com/ws/train-job-01-worker-0"。

curl -X 'GET' \
  'https://api.alayanew.com/api/osm/v1/training/instance/a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58/pods' \
  -H 'accept: application/json' \
  -H 'Authorization: [your-auth-header]'
import requests

task_id = "a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58"
url = f"https://api.alayanew.com/api/osm/v1/training/instance/{task_id}/pods"
headers = {
    "accept": "application/json",
    "Authorization": "[your-auth-header]"
}

response = requests.get(url, headers=headers)
print(response.json())
const taskId = 'a3c8f6d1-7b42-4e95-9d20-8f1a4c6b3e58';

fetch(`https://api.alayanew.com/api/osm/v1/training/instance/${taskId}/pods`, {
  method: 'GET',
  headers: {
    'accept': 'application/json',
    'Authorization': '[your-auth-header]'
  }
})
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
{
  "status": 200,
  "message": "OK",
  "data": [
    {
      "podName": "train-job-01-worker-0",
      "podIp": "10.233.250.123",
      "status": "running",
      "reason": "",
      "nodeName": "gpu-021",
      "createdTime": "2026-10-13 09:35:00",
      "updatedTime": "2026-10-13 09:36:10",
      "podWebSSH": "wss://console.example.com/ws/train-job-01-worker-0"
    }
  ]
}

最后更新于