获取作业的日志(GetTrainsPodLog)
更新时间:2025-05-08 07:50:27
仅限于未终止的作业。
基本信息
Action:/qai/aicp/trains/namespaces/{namespace}/endpoints/{endpoint}/logs
Method: GET
Content-Type:application/json
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
endpoint |
string |
任务类型,如 |
yes |
train_uuid |
string |
任务的 UUID |
yes |
namespace |
string |
命名空间名称。 |
yes |
query |
string |
查询关键字。 |
no |
pods_name |
array |
Pod 名称。 |
no |
start_time |
string |
开始时间。 |
no |
end_time |
string |
结束时间。 |
no |
container_name |
string |
容器名称。 |
no |
size |
integer |
返回日志条数。 |
no |
page |
integer |
页码,默认值为 1。 |
no |
reverse |
boolean |
是否按时间倒序排序。 |
no |
fuzzy |
boolean |
是否模糊查询,默认为 true,支持模糊查询。 |
no |
响应参数
此接口包含的公共响应参数,可参见前文内容,其他参数介绍如下:
参数 | 类型 | 描述 |
---|---|---|
data.cluster |
string |
集群名称。 |
data.kubernetes |
string |
Kubernetes 容器实例基本信息。 |
data.log |
string |
日志内容。 |
data.time |
string |
时间范围。 |
data.timestamp |
string |
时间戳。 |
data.unixtime |
string |
统一时间。 |
请求示例
curl -X 'GET' \
'https://ai.coreshub.cn/qai/aicp/trains/namespaces/usr-5HY8cxxx/endpoints/tfjobs/logs?train_uuid=tn-ehjysfi2my2o&size=100&page=1&reverse=true&fuzzy=true' \
-H 'accept: application/json'
响应示例
{
"ret_code": 0,
"message": "success",
"meta": {
"X_REQUEST_ID": "string",
"X_REQUEST_USER": "string"
},
"data": [
{
"cluster": "string",
"kubernetes": {},
"log": "string",
"time": "string",
"timestamp": "string",
"unixtime": "string"
}
],
"counts": 0
}