doc-exports/docs/modelarts/api-ref/ShowObsUrlOfTrainingJobLogs.html
Wuwan, Qi f81ead2467 ModelArts API 24.3.0 20241128 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
2024-11-29 09:04:54 +00:00

128 lines
10 KiB
HTML

<a name="EN-US_TOPIC_0000002079045737"></a><a name="EN-US_TOPIC_0000002079045737"></a>
<h1 class="topictitle1">Querying the Logs of a Specified Task in a Training Job (OBS Link)</h1>
<div id="body1675154171816"><div class="section" id="EN-US_TOPIC_0000002079045737__section136759416183"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000002079045737__p1567615431816">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_0000002079045737__section8676941185"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000002079045737__p16677104201820">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_0000002079045737__table16791461816" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Path Parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002079045737__row18678114121815"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.1"><p id="EN-US_TOPIC_0000002079045737__p4679154161813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.2"><p id="EN-US_TOPIC_0000002079045737__p867964131813">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.2.3.2.5.1.3"><p id="EN-US_TOPIC_0000002079045737__p1268016491817">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.2.3.2.5.1.4"><p id="EN-US_TOPIC_0000002079045737__p19680174121818">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002079045737__row26789416189"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002079045737__p106811447183">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002079045737__p268119419182">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002079045737__p186821419183">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002079045737__p166839418183">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_0000002079045737__row567810461812"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002079045737__p14684134181810">training_job_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002079045737__p1468418417184">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002079045737__p14685114141814">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002079045737__p4685164161813">ID of a training job.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000002079045737__row18678124171812"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.1 "><p id="EN-US_TOPIC_0000002079045737__p168614415189">task_id</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.2 "><p id="EN-US_TOPIC_0000002079045737__p1668716418181">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.2.3.2.5.1.3 "><p id="EN-US_TOPIC_0000002079045737__p96872461815">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.2.3.2.5.1.4 "><p id="EN-US_TOPIC_0000002079045737__p76881411817">Name of a training job. You can obtain the value from the <strong id="EN-US_TOPIC_0000002079045737__b16882411811">status.tasks</strong> field in the training job details.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002079045737__section186889420189"><h4 class="sectiontitle">Request Parameters</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079045737__HeaderParameter" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request header parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000002079045737__row1468916419184"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.1"><p id="EN-US_TOPIC_0000002079045737__p8690104201813">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.2"><p id="EN-US_TOPIC_0000002079045737__p1169011401814">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.3.2.2.5.1.3"><p id="EN-US_TOPIC_0000002079045737__p769115431813">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.2.5.1.4"><p id="EN-US_TOPIC_0000002079045737__p126915431814">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002079045737__row968917491818"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.1 "><p id="EN-US_TOPIC_0000002079045737__p969215416187">Content-Type</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.2 "><p id="EN-US_TOPIC_0000002079045737__p9692114191814">No</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.3.2.2.5.1.3 "><p id="EN-US_TOPIC_0000002079045737__p96921148185">String</p>
</td>
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.2.5.1.4 "><p id="EN-US_TOPIC_0000002079045737__p76931747187">Message body type. If this parameter is set to text/plain, the temporary preview link is returned. Set this parameter to application/octet-stream. A temporary download link is returned.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002079045737__section17693204191816"><h4 class="sectiontitle">Response Parameters</h4><p id="EN-US_TOPIC_0000002079045737__p8693344181"><strong id="EN-US_TOPIC_0000002079045737__b269374141813">Status code: 200</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079045737__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_0000002079045737__row969454161817"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.1"><p id="EN-US_TOPIC_0000002079045737__p36952417184">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.4.3.2.4.1.2"><p id="EN-US_TOPIC_0000002079045737__p17695445184">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.4.3.2.4.1.3"><p id="EN-US_TOPIC_0000002079045737__p16956411813">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002079045737__row5694746181"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.1 "><p id="EN-US_TOPIC_0000002079045737__p369614151818">obs_url</p>
</td>
<td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.4.3.2.4.1.2 "><p id="EN-US_TOPIC_0000002079045737__p116966431820">String</p>
</td>
<td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.4.3.2.4.1.3 "><p id="EN-US_TOPIC_0000002079045737__p369619417185">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_0000002079045737__section369714481812"><h4 class="sectiontitle">Example Requests</h4><p id="EN-US_TOPIC_0000002079045737__p069704121811">The following shows how to query the temporary OBS URL for the <strong id="EN-US_TOPIC_0000002079045737__b069720491817">work-0</strong> tasks of the training job whose UUID is <strong id="EN-US_TOPIC_0000002079045737__b14697174171817">2cd88daa-31a4-40a8-a58f-d186b0e93e4f</strong>.</p>
<pre class="screen" id="EN-US_TOPIC_0000002079045737__screen769713481810">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_0000002079045737__section1669813416185"><h4 class="sectiontitle">Example Responses</h4><p id="EN-US_TOPIC_0000002079045737__p1769815411820"><strong id="EN-US_TOPIC_0000002079045737__b1869811411188">Status code: 200</strong></p>
<p id="EN-US_TOPIC_0000002079045737__p126981849182">ok</p>
<pre class="screen" id="EN-US_TOPIC_0000002079045737__screen12698145185">{
"obs_url" : "http://10.155.101.248:20000/xxxxxx-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_0000002079045737__section569914421810"><h4 class="sectiontitle">Status Codes</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000002079045737__status_code" frame="border" border="1" rules="all"><thead align="left"><tr id="EN-US_TOPIC_0000002079045737__row157001445184"><th align="left" class="cellrowborder" valign="top" width="15%" id="mcps1.3.7.2.1.3.1.1"><p id="EN-US_TOPIC_0000002079045737__p157006421818">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="85%" id="mcps1.3.7.2.1.3.1.2"><p id="EN-US_TOPIC_0000002079045737__p770024181818">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000002079045737__row9700144121810"><td class="cellrowborder" valign="top" width="15%" headers="mcps1.3.7.2.1.3.1.1 "><p id="EN-US_TOPIC_0000002079045737__p1270110418185">200</p>
</td>
<td class="cellrowborder" valign="top" width="85%" headers="mcps1.3.7.2.1.3.1.2 "><p id="EN-US_TOPIC_0000002079045737__p270116421813">ok</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000002079045737__section157015416188"><h4 class="sectiontitle">Error Codes</h4><p id="EN-US_TOPIC_0000002079045737__p170104191814">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>