doc-exports/docs/mrs/api-ref/mrs_02_0086.html
Yang, Tong 9d3e5175d0 MRS API-Doc 20231220 version update
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com>
Co-authored-by: Yang, Tong <yangtong2@huawei.com>
Co-committed-by: Yang, Tong <yangtong2@huawei.com>
2024-02-19 11:25:29 +00:00

224 lines
18 KiB
HTML

<a name="mrs_02_0086"></a><a name="mrs_02_0086"></a>
<h1 class="topictitle1">Querying Information About a Job</h1>
<div id="body1561687300308"><div class="section" id="mrs_02_0086__section4408504619327"><h4 class="sectiontitle">Function</h4><p id="mrs_02_0086__p5843728119329">This API is used to query information about a specified job in an MRS cluster.</p>
</div>
<div class="section" id="mrs_02_0086__section10186656193217"><h4 class="sectiontitle">URI</h4><ul id="mrs_02_0086__ul2809877319471"><li id="mrs_02_0086__li5177607319471">Format<p id="mrs_02_0086__p441284219563"><a name="mrs_02_0086__li5177607319471"></a><a name="li5177607319471"></a>GET /v2/{project_id}/clusters/{cluster_id}/job-executions/{job_execution_id}</p>
</li><li id="mrs_02_0086__li2957566119471">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0086__table49499141194754" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameter description</caption><thead align="left"><tr id="mrs_02_0086__row33700024194754"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.4.1.1"><p id="mrs_02_0086__p16571835194812">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.2.2.2.1.2.4.1.2"><p id="mrs_02_0086__p141410194812">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.2.2.2.1.2.4.1.3"><p id="mrs_02_0086__p11454278194812">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_02_0086__row39786771142917"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0086__p1503055142917">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0086__p54638598142917">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0086__p63650338142917">Project ID. For details on how to obtain the project ID, see <a href="mrs_02_0011.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="mrs_02_0086__row3457216201210"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0086__p194589160122">cluster_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0086__p045813165125">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0086__p1845891641218">Cluster ID. For details on how to obtain the cluster ID, see <a href="mrs_02_0091.html#mrs_02_0091__section177891315153619">Obtaining a Cluster ID</a>.</p>
</td>
</tr>
<tr id="mrs_02_0086__row121835121146"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.1 "><p id="mrs_02_0086__p218419125412">job_execution_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.2.2.2.1.2.4.1.2 "><p id="mrs_02_0086__p16184161212420">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.2.2.2.1.2.4.1.3 "><p id="mrs_02_0086__p121844121440">Job ID. For details on how to obtain the job ID, see <a href="mrs_02_0091.html#mrs_02_0091__section247234143612">Obtaining a Job ID</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="mrs_02_0086__section673761354213"><h4 class="sectiontitle">Request</h4><p id="mrs_02_0086__p1842961591514"><strong id="mrs_02_0086__b15113153022815">Request parameters</strong></p>
<p id="mrs_02_0086__p106160258151">None.</p>
</div>
<div class="section" id="mrs_02_0086__section775516131425"><h4 class="sectiontitle">Response</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0086__table196481619161412" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameter description</caption><thead align="left"><tr id="mrs_02_0086__row1564911199147"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.2.4.1.1"><p id="mrs_02_0086__p38002029181415">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.2.2.4.1.2"><p id="mrs_02_0086__p1580062910148">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.2.2.4.1.3"><p id="mrs_02_0086__p1580082971414">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_02_0086__row11649141915141"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.1 "><p id="mrs_02_0086__p3649101914144">job_detail</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.2.2.4.1.2 "><p id="mrs_02_0086__p136493195149">Object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.4.1.3 "><p id="mrs_02_0086__p136497196148">Job details. For details about the parameter, see <a href="#mrs_02_0086__table12040613193927">Table 3</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="mrs_02_0086__table12040613193927"></a><a name="table12040613193927"></a><table cellpadding="4" cellspacing="0" summary="" id="mrs_02_0086__table12040613193927" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Job parameter description</caption><thead align="left"><tr id="mrs_02_0086__row8843854193927"><th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.1"><p id="mrs_02_0086__p45263556193927">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25%" id="mcps1.3.4.3.2.4.1.2"><p id="mrs_02_0086__p1907984993927">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.4.1.3"><p id="mrs_02_0086__p17473879193927">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="mrs_02_0086__row8387056194027"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p52943541117">job_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p12125168101212">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p6329191671215">Job ID.</p>
</td>
</tr>
<tr id="mrs_02_0086__row19100834201113"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p1029418549112">user</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p512508201214">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p183294166123">Name of the user who submits a job.</p>
</td>
</tr>
<tr id="mrs_02_0086__row1850318495114"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p12294125416119">job_name</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p191251789127">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p153291516111218">Job name. It contains 1 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed.</p>
</td>
</tr>
<tr id="mrs_02_0086__row1910618551609"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p1341817597018">job_result</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p12418185915018">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p741885912014">Final result of a job.</p>
<ul id="mrs_02_0086__ul141131420762"><li id="mrs_02_0086__en-us_topic_0177065249_li4570026101110"><strong id="mrs_02_0086__b592201213115036">FAILED</strong>: indicates that the job fails to be executed.</li><li id="mrs_02_0086__en-us_topic_0177065249_li5918102912116"><strong id="mrs_02_0086__b1565772299115036">KILLED</strong>: indicates that the job is manually terminated during execution.</li><li id="mrs_02_0086__en-us_topic_0177065249_li13168123601111"><strong id="mrs_02_0086__b1620579513115036">UNDEFINED</strong>: indicates that the job is being executed.</li><li id="mrs_02_0086__en-us_topic_0177065249_li1759162381115"><strong id="mrs_02_0086__b1598016396115036">SUCCEEDED</strong>: indicates that the job has been successfully executed.</li></ul>
</td>
</tr>
<tr id="mrs_02_0086__row128711949131111"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p16294105413112">job_state</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p11261885121">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p232941614125">Execution status of a job.</p>
<ul id="mrs_02_0086__ul83814473515"><li id="mrs_02_0086__en-us_topic_0177065249_li15604174916382">FAILED: failed</li><li id="mrs_02_0086__en-us_topic_0177065249_li1248675273819"><strong id="mrs_02_0086__b1729590508115036">KILLED</strong>: indicates that the job is terminated.</li><li id="mrs_02_0086__en-us_topic_0177065249_li107931014396"><strong id="mrs_02_0086__b585636884115036">New</strong>: indicates that the job is created.</li><li id="mrs_02_0086__en-us_topic_0177065249_li9837050393"><strong id="mrs_02_0086__b439757850115036">NEW_SAVING</strong>: indicates that the job has been created and is being saved.</li><li id="mrs_02_0086__en-us_topic_0177065249_li6282913398"><strong id="mrs_02_0086__b260353259115036">SUBMITTED</strong>: indicates that the job is submitted.</li><li id="mrs_02_0086__en-us_topic_0177065249_li4972101003915"><strong id="mrs_02_0086__b404951412115036">ACCEPTED</strong>: indicates that the job is accepted.</li><li id="mrs_02_0086__en-us_topic_0177065249_li8221111516393"><strong id="mrs_02_0086__b855451555115036">RUNNING</strong>: indicates that the job is running.</li><li id="mrs_02_0086__en-us_topic_0177065249_li1879811547380"><strong id="mrs_02_0086__b885099976115036">FINISHED</strong>: indicates that the job is completed.</li></ul>
</td>
</tr>
<tr id="mrs_02_0086__row11227205011116"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p16294105418112">job_progress</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p612614821210">Float</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p832915169122">Job execution progress.</p>
</td>
</tr>
<tr id="mrs_02_0086__row11400175061120"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p729415401114">job_type</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p13126198181216">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p532941620128">Type of a job.</p>
<ul id="mrs_02_0086__ul58695132184"><li id="mrs_02_0086__en-us_topic_0176713997_li6488797415590">MapReduce</li><li id="mrs_02_0086__en-us_topic_0176713997_li5869295015590">SparkSubmit</li><li id="mrs_02_0086__en-us_topic_0176713997_li1378917415590">HiveScript</li><li id="mrs_02_0086__en-us_topic_0176713997_li802328715590">HiveSql</li><li id="mrs_02_0086__en-us_topic_0176713997_li33888041111020">DistCp, importing and exporting data</li><li id="mrs_02_0086__en-us_topic_0176713997_li48044655111024">SparkScript</li><li id="mrs_02_0086__en-us_topic_0176713997_li7152765111027">SparkSql</li><li id="mrs_02_0086__en-us_topic_0176713997_li356874719148">Flink</li></ul>
</td>
</tr>
<tr id="mrs_02_0086__row12272193451118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p1629585451114">started_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p1612698121215">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p1433061611218">Start time to run a job. Unit: ms.</p>
</td>
</tr>
<tr id="mrs_02_0086__row139751543313"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p169751343516">submitted_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p1497516434114">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p169754431714">Time when a job is submitted. Unit: ms.</p>
</td>
</tr>
<tr id="mrs_02_0086__row24471734181115"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p13295554131120">finished_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p1012618817121">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p1333011651212">End time to run a job. Unit: ms.</p>
</td>
</tr>
<tr id="mrs_02_0086__row186142034131118"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p8295135413112">elapsed_time</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p1612617841214">Long</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p733061610128">Running duration of a job. Unit: ms.</p>
</td>
</tr>
<tr id="mrs_02_0086__row6780123481117"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p62951654141119">arguments</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p51269812128">Array</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p93301716191220">Running parameter. The parameter contains a maximum of 4,096 characters, excluding special characters such as ;|&amp;&gt;'&lt;$, and can be left blank.</p>
</td>
</tr>
<tr id="mrs_02_0086__row4950134131116"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p18295154101116">properties</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p181261986126">Object</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p1133020163121">Configuration parameter, which is used to configure <strong id="mrs_02_0086__b4449156204014">-d</strong> parameters. The parameter contains a maximum of 2,048 characters, excluding special characters such as &gt;&lt;|'`&amp;!\, and can be left blank.</p>
</td>
</tr>
<tr id="mrs_02_0086__row34573461227"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p103136481121">launcher_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p139311522020">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p20244195418212">Launcher job ID.</p>
</td>
</tr>
<tr id="mrs_02_0086__row1687919461120"><td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.1 "><p id="mrs_02_0086__p031334815212">app_id</p>
</td>
<td class="cellrowborder" valign="top" width="25%" headers="mcps1.3.4.3.2.4.1.2 "><p id="mrs_02_0086__p149310528220">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.4.1.3 "><p id="mrs_02_0086__p1624412541822">Actual job ID.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="mrs_02_0086__section1210015461189"><h4 class="sectiontitle">Example</h4><ul id="mrs_02_0086__ul1958913536182"><li id="mrs_02_0086__li1558945321814">Example request<p id="mrs_02_0086__p83171441151516"><a name="mrs_02_0086__li1558945321814"></a><a name="li1558945321814"></a>None.</p>
</li><li id="mrs_02_0086__li543710159193">Example response<ul id="mrs_02_0086__ul64732058171511"><li id="mrs_02_0086__li622383915152">Example of a successful response<pre class="screen" id="mrs_02_0086__screen9223173941513">{
"job_detail": {
"job_id": "431b135e-c090-489f-b1db-0abe3822b855",
"user": "xxxx",
"job_name": "pyspark1",
"job_result": "SUCCEEDED",
"job_state": "FINISHED",
"job_progress": 100,
"job_type": "SparkSubmit",
"started_time": 1564626578817,
"submitted_time": 1564626561541,
"finished_time": 1564626664930,
"elapsed_time": 86113,
"queue": "default",
"arguments": "[--class, org.apache.spark.examples.SparkPi, --driver-memory, 512MB, --num-executors, 1, --executor-cores, 1, --master, yarn-cluster, obs://obs-test/jobs/spark/spark-examples_2.11-2.1.0.jar, 10000]",
"launcher_id": "application_1564622673393_0006",
"app_id": "application_1564622673393_0007",
"properties": "{}"
}
}</pre>
</li><li id="mrs_02_0086__li1480742111816">Example of a failed response<pre class="screen" id="mrs_02_0086__screen9377651201811">{
"error_msg": "Failed to query the job."
"error_code":"0162"
}</pre>
</li></ul>
</li></ul>
</div>
<div class="section" id="mrs_02_0086__section4391766619434"><h4 class="sectiontitle">Status Code</h4><p id="mrs_02_0086__p1693116917524">For details about status codes, see <a href="mrs_02_0015.html">Status Codes</a>.</p>
<div class="note" id="mrs_02_0086__note21494311288"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="mrs_02_0086__p39461794572">Generally, if status code 200 is returned, an API is successfully called. However, due to compatibility problems in earlier versions, the status code for a successful call of this API is 202. You can use status code 202 to check whether the response to this API is normal.</p>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mrs_02_0084.html">Job Object APIs (V2)</a></div>
</div>
</div>