Files
doc-exports/docs/modelarts/api-ref/modelarts_03_0054.html
2025-07-28 12:24:54 +00:00

120 lines
10 KiB
HTML

<a name="EN-US_TOPIC_0000002340898786"></a><a name="EN-US_TOPIC_0000002340898786"></a>
<h1 class="topictitle1">Obtaining the Name of a Training Job Log File</h1>
<div id="body1536922910940"><div class="section" id="EN-US_TOPIC_0000002340898786__section43804588"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000002340898786__p11927413">This API is used to obtain the name of a training job log file.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002340898786__section58696980"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000002340898786__p911665119334">GET /v1/{project_id}/training-jobs/{job_id}/versions/{version_id}/log/file-names</p>
<div class="p" id="EN-US_TOPIC_0000002340898786__p9934123094819"><a href="#EN-US_TOPIC_0000002340898786__table4669394316232">Table 1</a> describes the required parameters.
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002340898786__table4669394316232"></a><a name="table4669394316232"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002340898786__table4669394316232" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002340898786__row1698378816232"><th align="left" class="cellrowborder" valign="top" width="17.25%" id="mcps1.3.2.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000002340898786__p3928616250">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.540000000000001%" id="mcps1.3.2.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000002340898786__p318220716250">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.09%" id="mcps1.3.2.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000002340898786__p5643224916250">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.120000000000005%" id="mcps1.3.2.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000002340898786__p760948416250">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002340898786__row6661219316232"><td class="cellrowborder" valign="top" width="17.25%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000002340898786__p6394012216250">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.540000000000001%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000002340898786__p1176739816250">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.09%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000002340898786__p1363517816250">String</p>
</td>
<td class="cellrowborder" valign="top" width="55.120000000000005%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000002340898786__p3070766316250">Project ID. For details about how to obtain a project ID, see <a href="modelarts_03_0147.html">Obtaining a Project ID and Name</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002340898786__row2898837316232"><td class="cellrowborder" valign="top" width="17.25%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000002340898786__p1217225116250">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.540000000000001%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000002340898786__p4642824116250">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.09%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000002340898786__p259117616250">Long</p>
</td>
<td class="cellrowborder" valign="top" width="55.120000000000005%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000002340898786__p855869516250">ID of a training job</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002340898786__row212991911419"><td class="cellrowborder" valign="top" width="17.25%" headers="mcps1.3.2.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000002340898786__p1131191914416">version_id</p>
</td>
<td class="cellrowborder" valign="top" width="15.540000000000001%" headers="mcps1.3.2.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000002340898786__p453211267419">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="12.09%" headers="mcps1.3.2.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000002340898786__p15131119148">Long</p>
</td>
<td class="cellrowborder" valign="top" width="55.120000000000005%" headers="mcps1.3.2.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000002340898786__p15131161912419">Version ID of a training job</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002340898786__section441563135511"><h4 class="sectiontitle">Request Body</h4><p id="EN-US_TOPIC_0000002340898786__p1560514112019">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000002340898786__section41752178"><h4 class="sectiontitle">Response Body</h4><div class="p" id="EN-US_TOPIC_0000002340898786__p11831964210"><a href="#EN-US_TOPIC_0000002340898786__table3969737616316">Table 2</a> describes the response parameters.
<div class="tablenoborder"><a name="EN-US_TOPIC_0000002340898786__table3969737616316"></a><a name="table3969737616316"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002340898786__table3969737616316" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002340898786__row4420603516316"><th align="left" class="cellrowborder" valign="top" width="17.341734173417343%" id="mcps1.3.4.2.2.2.4.1.1"><p id="EN-US_TOPIC_0000002340898786__p201671416332">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="12.04120412041204%" id="mcps1.3.4.2.2.2.4.1.2"><p id="EN-US_TOPIC_0000002340898786__p1121753616332">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="70.61706170617062%" id="mcps1.3.4.2.2.2.4.1.3"><p id="EN-US_TOPIC_0000002340898786__p3620524816332">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002340898786__row4112635105011"><td class="cellrowborder" valign="top" width="17.341734173417343%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002340898786__p2530905217407">is_success</p>
</td>
<td class="cellrowborder" valign="top" width="12.04120412041204%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000002340898786__p2536505617407">Boolean</p>
</td>
<td class="cellrowborder" valign="top" width="70.61706170617062%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000002340898786__p4130369517407">Whether the request is successful</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002340898786__row13693818959"><td class="cellrowborder" valign="top" width="17.341734173417343%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002340898786__p36949182517">error_message</p>
</td>
<td class="cellrowborder" valign="top" width="12.04120412041204%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000002340898786__p4694111814518">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.61706170617062%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000002340898786__p1883217281754">Error message of a failed API call.</p>
<p id="EN-US_TOPIC_0000002340898786__p283417281056">This parameter is not included when the API call succeeds.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002340898786__row1122668316316"><td class="cellrowborder" valign="top" width="17.341734173417343%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002340898786__p2549041516332">error_code</p>
</td>
<td class="cellrowborder" valign="top" width="12.04120412041204%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000002340898786__p732886516332">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.61706170617062%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000002340898786__p5676720116332">Error code of a failed API call. For details, see <a href="modelarts_03_0095.html">Error Codes</a>. This parameter is not included when the API call succeeds.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002340898786__row977626816316"><td class="cellrowborder" valign="top" width="17.341734173417343%" headers="mcps1.3.4.2.2.2.4.1.1 "><p id="EN-US_TOPIC_0000002340898786__p306381116332">log_file_list</p>
</td>
<td class="cellrowborder" valign="top" width="12.04120412041204%" headers="mcps1.3.4.2.2.2.4.1.2 "><p id="EN-US_TOPIC_0000002340898786__p3611764516332">String</p>
</td>
<td class="cellrowborder" valign="top" width="70.61706170617062%" headers="mcps1.3.4.2.2.2.4.1.3 "><p id="EN-US_TOPIC_0000002340898786__p3984816716332">Log file name of a training job. A single-node job has only one log file, and a distributed job has multiple log files.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002340898786__section443195819497"><h4 class="sectiontitle">Sample Request</h4><p id="EN-US_TOPIC_0000002340898786__p4865841105211">The following shows how to obtain the log files of the job whose <span class="parmname" id="EN-US_TOPIC_0000002340898786__parmname82704018156"><b>job_id</b></span> is <span class="parmvalue" id="EN-US_TOPIC_0000002340898786__parmvalue179443442153"><b>10</b></span> and <span class="parmname" id="EN-US_TOPIC_0000002340898786__parmname488519502152"><b>version_id</b></span> is <span class="parmvalue" id="EN-US_TOPIC_0000002340898786__parmvalue13856165614155"><b>10</b></span>.</p>
<pre class="screen" id="EN-US_TOPIC_0000002340898786__screen1992415226319">GET https://endpoint/v1/{project_id}/training-jobs/10/versions/10/log/file-names</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000002340898786__section1483730193110"><h4 class="sectiontitle">Sample Response</h4><ul id="EN-US_TOPIC_0000002340898786__ul19451744133111"><li id="EN-US_TOPIC_0000002340898786__li7945134415310">Successful response<pre class="screen" id="EN-US_TOPIC_0000002340898786__screen09451944113115">{
"is_success": true,
"log_file_list": [
"teseJob.0"
]
}</pre>
</li><li id="EN-US_TOPIC_0000002340898786__li9945344153118">Failed response<pre class="screen" id="EN-US_TOPIC_0000002340898786__screen29451644163114">{
"is_success": false,
"error_message": "Error string",
"error_code": "ModelArts.0105"
}</pre>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000002340898786__section16342114917109"><h4 class="sectiontitle">Status Code</h4><p id="EN-US_TOPIC_0000002340898786__p13114154211153">For details about the status code, see <a href="modelarts_03_0094.html">Status Code</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="modelarts_03_0044.html">Training Jobs</a></div>
</div>
</div>