获取训练作业的开放端口(GetTrainPodPorts)
更新时间:2025-05-23 05:48:51
,仅限于未终止的作业。
基本信息
Action:/qai/aicp/trains/namespaces/{namespace}/endpoints/{endpoint}/trains/{uuid}/pods_name/{pod_name}/ports
Method: GET
Content-Type:application/json
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
endpoint |
string |
任务类型,如 |
yes |
uuid |
string |
任务的 UUID,唯一标识。 |
yes |
pod_name |
string |
Pod 名称。 |
yes |
namespace |
string |
命名空间名称。 |
yes |
响应参数
此接口包含的公共响应参数,可参见前文内容,其他参数介绍如下:
参数 | 类型 | 描述 |
---|---|---|
data.url |
string |
URL 地址。 |
data.target_port |
string |
目标端口。 |
data.server_type |
string |
服务类型。 |
data.server_name |
string |
服务名称。 |
data.status |
string |
当前状态。 |
data.protocol |
string |
协议类型。 |
data.password |
string |
密码。 |
请求示例
curl -X 'GET' \
'https://ai.coreshub.cn/qai/aicp/trains/namespaces/usr-5HY8cxxx/endpoints/tfjobs/trains/tn-ehkoc749snpc/pods_name/tn-ehkoc749snpc-master-0/ports' \
-H 'accept: application/json'
响应示例
{
"ret_code": 0,
"message": "success",
"meta": {
"X_REQUEST_ID": "string",
"X_REQUEST_USER": "string"
},
"data": [
{
"url": "string",
"target_port": 0,
"server_type": "string",
"server_name": "string",
"status": false,
"protocol": "http",
"password": "string"
}
]
}