doc-exports/docs/modelarts/api-ref/ShowObsUrlOfTrainingJobLogs.html
Lai, Weijian 68e5cd0687 ModelArts API 23.3.0 Version.
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lai, Weijian <laiweijian4@huawei.com>
Co-committed-by: Lai, Weijian <laiweijian4@huawei.com>
2024-06-18 11:02:37 +00:00

130 lines
11 KiB
HTML

<a name="EN-US_TOPIC_0000001943967385"></a><a name="EN-US_TOPIC_0000001943967385"></a>
<h1 class="topictitle1">Querying the Logs of a Specified Task in a Training Job (OBS Link)</h1>
<div id="body0000001537833688"><div class="section" id="EN-US_TOPIC_0000001943967385__section5104192713330"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001943967385__p61041827133311">This API is used to obtain the logs of a specified task of a training job (temporary OBS link, which is valid for 5 minutes). You can view all logs or download the logs.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section11051327173320"><h4 class="sectiontitle">Debugging</h4><p id="EN-US_TOPIC_0000001943967385__p1210622793313">You can debug this API through automatic authentication in or use the SDK sample code generated by API Explorer.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section2010710273339"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000001943967385__p181071027153318">GET /v2/{project_id}/training-jobs/{training_job_id}/tasks/{task_id}/logs/url</p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001943967385__table1711042763311" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001943967385__row121081827203310"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.1"><p id="EN-US_TOPIC_0000001943967385__p111062720331">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.2"><p id="EN-US_TOPIC_0000001943967385__p5111132793313">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.3.2.5.1.3"><p id="EN-US_TOPIC_0000001943967385__p71113279332">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.3.2.5.1.4"><p id="EN-US_TOPIC_0000001943967385__p16112152719337">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001943967385__row1510892710330"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001943967385__p6112627163320">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001943967385__p141136278334">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001943967385__p1911313274338">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001943967385__p211462711337">Project ID. For details, see <a href="modelarts_03_0147.html">Obtaining a Project ID and Name</a>.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001943967385__row9109132711337"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001943967385__p121141227133312">training_job_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001943967385__p181155270332">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001943967385__p15115227103315">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001943967385__p121161327123314">ID of a training job.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001943967385__row91098277338"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001943967385__p1011732793310">task_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001943967385__p181174275339">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001943967385__p1011713279338">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001943967385__p81181727193311">Name of a training job.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section81181227143312"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001943967385__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001943967385__row18119192783310"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.1"><p id="EN-US_TOPIC_0000001943967385__p18120132753316">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.2"><p id="EN-US_TOPIC_0000001943967385__p12120122710336">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.2.2.5.1.3"><p id="EN-US_TOPIC_0000001943967385__p1312112273335">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.4.2.2.5.1.4"><p id="EN-US_TOPIC_0000001943967385__p6122152715336">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001943967385__row12119142743316"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.1 "><p id="EN-US_TOPIC_0000001943967385__p1122827123316">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.2 "><p id="EN-US_TOPIC_0000001943967385__p4123142712332">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.2.2.5.1.3 "><p id="EN-US_TOPIC_0000001943967385__p1912432703314">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.4.2.2.5.1.4 "><p id="EN-US_TOPIC_0000001943967385__p13124132703310"><strong id="EN-US_TOPIC_0000001943967385__b13125627163317">text/plain</strong> indicates that a temporary preview URL is returned. <strong id="EN-US_TOPIC_0000001943967385__b11255271331">application/octet-stream</strong> indicates that a temporary download URL is returned.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section121250272335"><h4 class="sectiontitle">Response Parameters</h4><p id="EN-US_TOPIC_0000001943967385__p71251627113311"><strong id="EN-US_TOPIC_0000001943967385__b1212610279332">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001943967385__response_LogObsUrl" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response body parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001943967385__row15126152733315"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.3.2.4.1.1"><p id="EN-US_TOPIC_0000001943967385__p13127427133314">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.5.3.2.4.1.2"><p id="EN-US_TOPIC_0000001943967385__p9128162743313">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.5.3.2.4.1.3"><p id="EN-US_TOPIC_0000001943967385__p1112813279332">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001943967385__row212612703318"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.1 "><p id="EN-US_TOPIC_0000001943967385__p912932763317">obs_url</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.5.3.2.4.1.2 "><p id="EN-US_TOPIC_0000001943967385__p17130162703312">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.5.3.2.4.1.3 "><p id="EN-US_TOPIC_0000001943967385__p413020275337">Temporary OBS URL of logs. You can copy the URL to the browser to view the current complete logs.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section181301727173316"><h4 class="sectiontitle">Example Requests</h4><p id="EN-US_TOPIC_0000001943967385__p1413122723314">The following shows how to query the temporary OBS URL for the <strong id="EN-US_TOPIC_0000001943967385__b1313116274337">work-0</strong> tasks of the training job whose UUID is <strong id="EN-US_TOPIC_0000001943967385__b1813217275334">2cd88daa-31a4-40a8-a58f-d186b0e93e4f</strong>.</p>
<pre class="screen" id="EN-US_TOPIC_0000001943967385__screen81321227193311">GET https://endpoint/v2/{project_id}/training-jobs/2cd88daa-31a4-40a8-a58f-d186b0e93e4f/tasks/worker-0/logs/url?Content-Type=text/plain</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section113392716338"><h4 class="sectiontitle">Example Responses</h4><p id="EN-US_TOPIC_0000001943967385__p1013452713332"><strong id="EN-US_TOPIC_0000001943967385__b161341727143313">Status code: 200</strong></p>
<p id="EN-US_TOPIC_0000001943967385__p18134182703311">ok</p>
<pre class="screen" id="EN-US_TOPIC_0000001943967385__screen11135527103315">{
"obs_url" : "http://10.155.101.248:20000/xxxxx-test/xk/00chess_test/test11/logs/modelarts-job-0f2ccdbb-4f34-4d53-afb9-d526f3be8c68-ma-platform-init-worker-0-172.16.24.51-01909681.log?AWSAccessKeyId=xxxxx"
}</pre>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section51361827143318"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001943967385__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000001943967385__row1713752719337"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.8.2.1.3.1.1"><p id="EN-US_TOPIC_0000001943967385__p1413811275331">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.8.2.1.3.1.2"><p id="EN-US_TOPIC_0000001943967385__p161385270337">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001943967385__row7137102703316"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.8.2.1.3.1.1 "><p id="EN-US_TOPIC_0000001943967385__p813902719335">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.8.2.1.3.1.2 "><p id="EN-US_TOPIC_0000001943967385__p20140192733319">ok</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001943967385__section414015279330"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0000001943967385__p6140427113310">See <a href="modelarts_03_0095.html">Error Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="algorithms.html">Training Management</a></div>
</div>
</div>